TBT_Enhancedgrid - Version 1.3.4.1

Version Notes

Download this release

Release Info

Developer Jay El-Kaake
Extension TBT_Enhancedgrid
Version 1.3.4.1
Comparing to
See all releases


Code changes from version 1.3.2.1 to 1.3.4.1

Files changed (32) hide show
  1. app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php +61 -65
  2. app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php +681 -660
  3. app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid/Columns.php +1 -1
  4. app/code/community/TBT/Enhancedgrid/Block/System/Html.php +92 -92
  5. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column.php +16 -13
  6. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Category.php +34 -39
  7. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Image.php +34 -31
  8. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Action.php +83 -77
  9. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Category.php +86 -87
  10. app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Image.php +122 -117
  11. app/code/community/TBT/Enhancedgrid/Block/Widget/Loyalty.php +65 -61
  12. app/code/community/TBT/Enhancedgrid/Helper/Data.php +66 -66
  13. app/code/community/TBT/Enhancedgrid/Helper/Version.php +257 -219
  14. app/code/community/TBT/Enhancedgrid/Model/Collection/Decorator/Abstract.php +41 -37
  15. app/code/community/TBT/Enhancedgrid/Model/Product/Collection/Category/Decorator.php +69 -71
  16. app/code/community/TBT/Enhancedgrid/Model/Product/Grid/Settings/Columns.php +189 -184
  17. app/code/community/TBT/Enhancedgrid/Model/Resource/Eav/Mysql4/Product/Collection.php +53 -52
  18. app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Columns/Show.php +68 -67
  19. app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Sort/Direction.php +13 -12
  20. app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php +178 -154
  21. app/code/community/TBT/Enhancedgrid/etc/config.xml +138 -163
  22. app/code/community/TBT/Enhancedgrid/etc/system.xml +142 -182
  23. app/code/community/TBT/Enhancedgrid/sql/enhancedgrid_setup/mysql4-install-1.0.0.0.php +25 -26
  24. app/design/adminhtml/default/default/layout/tbt_enhancedgrid.xml +4 -4
  25. app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product.phtml +0 -45
  26. app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product/grid.phtml +0 -192
  27. app/etc/modules/TBT_Enhancedgrid.xml +1 -1
  28. js/tbt/enhancedgrid/customfunctions/catalog_products.js +0 -112
  29. js/tbt/enhancedgrid/egsupplemental.js +0 -73
  30. js/tbt/enhancedgrid/enhancedgrid.js +0 -380
  31. js/tbt/enhancedgrid/resources/css/enhancedgrid.css +0 -2
  32. package.xml +10 -11
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php CHANGED
@@ -1,65 +1,61 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
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
-
37
- public function __construct()
38
- {
39
- parent::__construct();
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
- //@nelkaake -a 16/11/10:
51
- $store_switcher = $this->getLayout()->createBlock('adminhtml/store_switcher', 'store_switcher');
52
- $store_switcher->setUseConfirm(false);
53
- $this->setChild('store_switcher', $store_switcher);
54
-
55
- $this->setChild('add_new_button',
56
- $this->getLayout()->createBlock('adminhtml/widget_button')
57
- ->setData(array(
58
- 'label' => Mage::helper('catalog')->__('Add Product'),
59
- 'onclick' => "setLocation('".$this->getUrl('adminhtml/*/new')."')",
60
- 'class' => 'add'
61
- ))
62
- );
63
- }
64
- }
65
-
1
+ <?php
2
+ /**
3
+ * Sweet Tooth.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
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 Sweet Tooth
31
+ * @author Jay El-Kaake <jay@sweettoothhq.com>
32
+ */
33
+ class TBT_Enhancedgrid_Block_Catalog_Product extends Mage_Adminhtml_Block_Catalog_Product
34
+ {
35
+ public function __construct()
36
+ {
37
+ parent::__construct();
38
+ $this->_headerText = Mage::helper('enhancedgrid')->__('Manage Products (Enhanced)');
39
+ }
40
+
41
+ protected function _prepareLayout()
42
+ {
43
+ parent::_prepareLayout();
44
+ $this->setTemplate('tbt'.DS.'enhancedgrid'.DS.'catalog'.DS.'product.phtml');
45
+ $this->setChild('grid', $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid', 'product.enhancedgrid'));
46
+
47
+ //@nelkaake -a 16/11/10:
48
+ $store_switcher = $this->getLayout()->createBlock('adminhtml/store_switcher', 'store_switcher');
49
+ $store_switcher->setUseConfirm(false);
50
+ $this->setChild('store_switcher', $store_switcher);
51
+
52
+ $this->setChild('add_new_button',
53
+ $this->getLayout()->createBlock('adminhtml/widget_button')
54
+ ->setData(array(
55
+ 'label' => Mage::helper('catalog')->__('Add Product'),
56
+ 'onclick' => "setLocation('".$this->getUrl('adminhtml/*/new')."')",
57
+ 'class' => 'add',
58
+ ))
59
+ );
60
+ }
61
+ }
 
 
 
 
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php CHANGED
@@ -1,660 +1,681 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 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
- * Adminhtml customer grid block
29
- *
30
- * @category WDCA
31
- * @package TBT_Enhancedgrid
32
- * @author WDCA <contact@wdca.ca>
33
- */
34
- class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid {
35
-
36
- protected $isenhanced = true;
37
-
38
- private $columnSettings = array();
39
- protected $_columnSettings = null;
40
-
41
- private $columnOptions = array();
42
-
43
- private $isenabled = true;
44
-
45
- public function __construct() {
46
-
47
- $this->setTemplate( 'tbt/enhancedgrid/catalog/product/grid.phtml' );
48
- parent::__construct();
49
- $this->isenabled = Mage::getStoreConfig( 'enhancedgrid/general/isenabled' );
50
-
51
- $this->setId( 'productGrid' );
52
-
53
- $this->prepareDefaults();
54
-
55
- $this->setSaveParametersInSession( true );
56
- $this->setUseAjax( true );
57
- $this->setVarNameFilter( 'product_filter' );
58
-
59
- $this->prepareColumnSettings();
60
-
61
- }
62
-
63
- protected function prepareDefaults() {
64
- $this->setDefaultLimit( Mage::getStoreConfig( 'enhancedgrid/defaults/limit' ) );
65
- $this->setDefaultPage( Mage::getStoreConfig( 'enhancedgrid/defaults/page' ) );
66
- $this->setDefaultSort( Mage::getStoreConfig( 'enhancedgrid/defaults/sort' ) );
67
- $this->setDefaultDir( Mage::getStoreConfig( 'enhancedgrid/defaults/dir' ) );
68
-
69
- }
70
-
71
- protected function prepareColumnSettings() {
72
- $this->_columnSettings = Mage::getModel( 'enhancedgrid/product_grid_settings_columns' )->setStore( $this->_getStore() );
73
- $this->columnSettings = $this->_getColumnSettings()->getColumnSettingsArray();
74
-
75
- return $this;
76
- }
77
-
78
- /**
79
- * @return TBT_Enhancedgrid_Model_Product_Grid_Settings_Columns
80
- */
81
- protected function _getColumnSettings() {
82
- return $this->_columnSettings;
83
- }
84
-
85
- public function colIsVisible($code) {
86
- return isset( $this->columnSettings[$code] );
87
- }
88
-
89
- protected function _isSpecialCol($col) {
90
- return ($col == 'qty' || $col == 'websites' || $col == 'id' || $col == 'categories');
91
- }
92
-
93
- protected function _prepareLayout() {
94
- $this->setChild( 'export_button',
95
- $this->getLayout()
96
- ->createBlock( 'adminhtml/widget_button' )
97
- ->setData(
98
- array(
99
- 'label' => Mage::helper( 'adminhtml' )->__( 'Export' ),
100
- 'onclick' => $this->getJsObjectName() . '.doExport()',
101
- 'class' => 'task'
102
- ) ) );
103
- $this->setChild( 'reset_filter_button',
104
- $this->getLayout()
105
- ->createBlock( 'adminhtml/widget_button' )
106
- ->setData(
107
- array(
108
- 'label' => Mage::helper( 'adminhtml' )->__( 'Reset Filter' ),
109
- 'onclick' => $this->getJsObjectName() . '.resetFilter()'
110
- ) ) );
111
- $this->setChild( 'search_button',
112
- $this->getLayout()
113
- ->createBlock( 'adminhtml/widget_button' )
114
- ->setData(
115
- array(
116
- 'label' => Mage::helper( 'adminhtml' )->__( 'Search' ),
117
- 'onclick' => $this->getJsObjectName() . '.doFilter()',
118
- 'class' => 'task'
119
- ) ) );
120
- return parent::_prepareLayout();
121
- }
122
-
123
- public function getQueryStr() {
124
- return urldecode( $this->getParam( 'q' ) );
125
- }
126
-
127
- /**
128
- * get collection object
129
- * //@nelkaake -a 13/11/10: this is just here for the codeassist function
130
- *
131
- * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
132
- */
133
- public function getCollection() {
134
- return parent::getCollection();
135
- }
136
-
137
- protected function _prepareCollection() {
138
-
139
- $collection = $this->getCollection();
140
- //@nelkaake -m 13/11/10: Just made it a little nicer
141
- $queryString = $this->getQueryStr();
142
- if ( $queryString ) {
143
- $collection = Mage::helper( 'enhancedgrid' )->getSearchCollection( $queryString, $this->getRequest() );
144
- }
145
-
146
- if ( ! $collection ) {
147
- //@nelkaake -a 15/12/10: To fix categories column issue this is a tempoary way we are going to load the modified collection class.
148
- $collection = new TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection();
149
- }
150
- $store = $this->_getStore();
151
- $collection->joinField( 'qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left' );
152
- $collection->addAttributeToSelect( 'sku' );
153
-
154
- //$collection->addAttributeToSelect('attribute_set_id');
155
- //$collection->addAttributeToSelect('type_id');
156
-
157
-
158
- if ( $store->getId() ) {
159
- //$collection->setStoreId($store->getId());
160
- $collection->addStoreFilter( $store->getId() );
161
- $collection->joinAttribute( 'custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId() );
162
- $collection->joinAttribute( 'status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId() );
163
- $collection->joinAttribute( 'visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId() );
164
- $collection->joinAttribute( 'price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId() );
165
- } else {
166
- $collection->addAttributeToSelect( 'price' );
167
- $collection->addAttributeToSelect( 'status' );
168
- $collection->addAttributeToSelect( 'visibility' );
169
- }
170
- // EG: Select all needed columns.
171
- //id,name,type,attribute_set,sku,price,qty,visibility,status,websites,image
172
- foreach ($this->columnSettings as $col => $true) {
173
- if ( $this->_isSpecialCol( $col ) ) continue;
174
- $collection->addAttributeToSelect( $col );
175
- }
176
-
177
- if ( $this->colIsVisible( 'categories' ) ) {
178
- $this->setJoinCategories( true );
179
- }
180
-
181
- $this->setCollection( $collection );
182
-
183
- $this->addExportType( '*/*/exportCsv', Mage::helper( 'customer' )->__( 'CSV' ) );
184
- $this->addExportType( '*/*/exportXml', Mage::helper( 'customer' )->__( 'XML' ) );
185
-
186
- parent::_prepareCollection();
187
- $collection->addWebsiteNamesToResult();
188
-
189
- return $this;
190
- }
191
-
192
- /**
193
- * if the attribute has options an options entry will be
194
- * added to $columnOptions
195
- */
196
- protected function loadColumnOptions($attr_code) {
197
- $attr = Mage::getModel( 'eav/entity_attribute' )->loadByCode( 'catalog_product', $attr_code );
198
- if ( sizeof( $attr->getData() ) > 0 ) {
199
- if ( $attr->getFrontendInput() == 'select' ) {
200
- //@nelkaake -a 13/11/10:
201
- if ( $attr->getSourceModel() != null ) {
202
- $sourcemodel = Mage::getModel( $attr->getSourceModel() );
203
- //@nelkaake -a 16/11/10:
204
- $sourcemodel->setAttribute( $attr );
205
- if ( method_exists( $sourcemodel, 'getAllOptions' ) ) {
206
- try {
207
- //die($attr->getSourceModel());
208
- $values = $sourcemodel->getAllOptions();
209
-
210
- $options = array();
211
-
212
- foreach ($values as $value) {
213
-
214
- $options[$value['value']] = $value['label'];
215
- }
216
- //die($attr_code);
217
- $this->columnOptions[$attr_code] = $options;
218
- return;
219
- } catch ( Exception $e ) {
220
- Mage::log(
221
- "Tried to get options for {$attr_code} using getAllOptions on {$attr->getSourceModel()}, but an exception occured: " .
222
- (string) $e );
223
- }
224
- }
225
- }
226
- //@nelkaake -a 13/11/10:
227
- $values = Mage::getResourceModel( 'eav/entity_attribute_option_collection' )->setAttributeFilter(
228
- $attr->getId() )
229
- ->setStoreFilter( $this->_getStore()
230
- ->getId(), false )
231
- ->load();
232
- $options = array();
233
- foreach ($values as $value) {
234
- $options[$value->getOptionId()] = $value->getValue();
235
- }
236
- //die($attr_code);
237
- $this->columnOptions[$attr_code] = $options;
238
-
239
- //die(print_r($this->columnOptions, true));
240
- }
241
- }
242
-
243
- }
244
-
245
- protected function _getStore() {
246
- $storeId = (int) $this->getRequest()->getParam( 'store', 0 );
247
- $store = Mage::app()->getStore( $storeId );
248
- if ( $store->getId() != $storeId ) $store = Mage::app()->getStore( 0 );
249
- return $store;
250
- }
251
-
252
- protected function _addColumnFilterToCollection($column) {
253
- if ( $this->getCollection() ) {
254
- if ( $column->getId() == 'websites' ) {
255
- $this->getCollection()->joinField( 'websites', 'catalog/product_website', 'website_id', 'product_id=entity_id', null,
256
- 'left' );
257
- }
258
- }
259
- return parent::_addColumnFilterToCollection( $column );
260
- }
261
-
262
- protected function _prepareColumns() {
263
- // Loads all the column options for each applicable column.
264
- foreach ($this->columnSettings as $col => $true) {
265
- $this->loadColumnOptions( $col );
266
- }
267
-
268
- $store = $this->_getStore();
269
- if ( $this->colIsVisible( 'id' ) ) {
270
- $this->addColumn( 'id',
271
- array(
272
- 'header' => Mage::helper( 'catalog' )->__( 'ID' ),
273
- 'width' => '50px',
274
- 'type' => 'number',
275
- 'index' => 'entity_id'
276
- ) );
277
- }
278
-
279
- $imgWidth = Mage::getStoreConfig( 'enhancedgrid/images/width' ) + "px";
280
-
281
- if ( $this->colIsVisible( 'thumbnail' ) ) {
282
- $this->addColumn( 'thumbnail',
283
- array(
284
- 'header' => Mage::helper( 'catalog' )->__( 'Thumbnail' ),
285
- 'type' => 'image',
286
- 'width' => $imgWidth,
287
- 'index' => 'thumbnail'
288
- ) );
289
- }
290
- if ( $this->colIsVisible( 'small_image' ) ) {
291
- $this->addColumn( 'small_image',
292
- array(
293
- 'header' => Mage::helper( 'catalog' )->__( 'Small Img' ),
294
- 'type' => 'image',
295
- 'width' => $imgWidth,
296
- 'index' => 'small_image'
297
- ) );
298
- }
299
- if ( $this->colIsVisible( 'image' ) ) {
300
- $this->addColumn( 'image',
301
- array(
302
- 'header' => Mage::helper( 'catalog' )->__( 'Image' ),
303
- 'type' => 'image',
304
- 'width' => $imgWidth,
305
- 'index' => 'image'
306
- ) );
307
- }
308
-
309
- if ( $this->colIsVisible( 'name' ) ) {
310
- $this->addColumn( 'name',
311
- array(
312
- 'header' => Mage::helper( 'catalog' )->__( 'Name' ),
313
- 'index' => 'name'
314
- )// 'width' => '150px'
315
- );
316
- }
317
- if ( $this->colIsVisible( 'name' ) ) {
318
- if ( $store->getId() ) {
319
- $this->addColumn( 'custom_name',
320
- array(
321
- 'header' => Mage::helper( 'catalog' )->__( 'Name In %s', $store->getName() ),
322
- 'index' => 'custom_name',
323
- 'width' => '150px'
324
- ) );
325
- }
326
- }
327
-
328
- if ( $this->colIsVisible( 'type_id' ) ) {
329
- $this->addColumn( 'type',
330
- array(
331
- 'header' => Mage::helper( 'catalog' )->__( 'Type' ),
332
- 'width' => '60px',
333
- 'index' => 'type_id',
334
- 'type' => 'options',
335
- 'options' => Mage::getSingleton( 'catalog/product_type' )->getOptionArray()
336
- ) );
337
- }
338
-
339
- if ( $this->colIsVisible( 'attribute_set_id' ) ) {
340
- $sets = Mage::getResourceModel( 'eav/entity_attribute_set_collection' )->setEntityTypeFilter(
341
- Mage::getModel( 'catalog/product' )->getResource()
342
- ->getTypeId() )
343
- ->load()
344
- ->toOptionHash();
345
-
346
- $this->addColumn( 'set_name',
347
- array(
348
- 'header' => Mage::helper( 'catalog' )->__( 'Attrib. Set Name' ),
349
- 'width' => '100px',
350
- 'index' => 'attribute_set_id',
351
- 'type' => 'options',
352
- 'options' => $sets
353
- ) );
354
- }
355
-
356
- if ( $this->colIsVisible( 'sku' ) ) {
357
- $this->addColumn( 'sku',
358
- array(
359
- 'header' => Mage::helper( 'catalog' )->__( 'SKU' ),
360
- 'width' => '80px',
361
- 'index' => 'sku'
362
- ) );
363
- }
364
-
365
- if ( $this->colIsVisible( 'price' ) ) {
366
- $this->addColumn( 'price',
367
- array(
368
- 'header' => Mage::helper( 'catalog' )->__( 'Price' ),
369
- 'type' => 'price',
370
- 'currency_code' => $store->getBaseCurrency()
371
- ->getCode(),
372
- 'index' => 'price'
373
- ) );
374
- }
375
-
376
- if ( $this->colIsVisible( 'qty' ) ) {
377
- $this->addColumn( 'qty',
378
- array(
379
- 'header' => Mage::helper( 'catalog' )->__( 'Qty' ),
380
- 'width' => '100px',
381
- 'type' => 'number',
382
- 'index' => 'qty'
383
- ) );
384
- }
385
-
386
- if ( $this->colIsVisible( 'visibility' ) ) {
387
- $this->addColumn( 'visibility',
388
- array(
389
- 'header' => Mage::helper( 'catalog' )->__( 'Visibility' ),
390
- 'width' => '70px',
391
- 'index' => 'visibility',
392
- 'type' => 'options',
393
- 'options' => Mage::getModel( 'catalog/product_visibility' )->getOptionArray()
394
- ) );
395
- }
396
-
397
- if ( $this->colIsVisible( 'status' ) ) {
398
- $this->addColumn( 'status',
399
- array(
400
- 'header' => Mage::helper( 'catalog' )->__( 'Status' ),
401
- 'width' => '70px',
402
- 'index' => 'status',
403
- 'type' => 'options',
404
- 'options' => Mage::getSingleton( 'catalog/product_status' )->getOptionArray()
405
- ) );
406
- }
407
-
408
- if ( $this->colIsVisible( 'websites' ) ) {
409
- if ( ! Mage::app()->isSingleStoreMode() ) {
410
- $this->addColumn( 'websites',
411
- array(
412
- 'header' => Mage::helper( 'catalog' )->__( 'Websites' ),
413
- 'width' => '100px',
414
- 'sortable' => false,
415
- 'index' => 'websites',
416
- 'type' => 'options',
417
- 'options' => Mage::getModel( 'core/website' )->getCollection()
418
- ->toOptionHash()
419
- ) );
420
- }
421
- }
422
-
423
- if ( $this->colIsVisible( 'categories' ) ) {
424
- $this->addColumn( 'categories',
425
- array(
426
- 'header' => Mage::helper( 'catalog' )->__( 'Categories' ),
427
- 'width' => '100px',
428
- 'sortable' => true,
429
- 'index' => 'categories',
430
- 'sort_index' => 'category',
431
- 'filter_index' => 'category'
432
- ) );
433
- }
434
-
435
- $this->_addVariableColumns();
436
-
437
- $this->addColumn( 'action',
438
- array(
439
- 'header' => Mage::helper( 'catalog' )->__( 'Action' ),
440
- 'width' => '50px',
441
- 'type' => 'action',
442
- 'getter' => 'getId',
443
- 'actions' => array(
444
- array(
445
- 'caption' => Mage::helper( 'catalog' )->__( 'Edit' ),
446
- 'id' => "editlink",
447
- 'url' => array(
448
- 'base' => 'adminhtml/*/edit',
449
- 'params' => array(
450
- 'store' => $this->getRequest()
451
- ->getParam( 'store' )
452
- )
453
- ),
454
- 'field' => 'id'
455
- )
456
- ),
457
- 'filter' => false,
458
- 'sortable' => false,
459
- 'index' => 'stores'
460
- ) );
461
-
462
- $this->addRssList( 'rss/catalog/notifystock', Mage::helper( 'catalog' )->__( 'Notify Low Stock RSS' ) );
463
-
464
- return parent::_prepareColumns();
465
- }
466
-
467
- /**
468
- * Adds all the columns that are not part of the fixed configuration settings prepared above.
469
- *
470
- */
471
- protected function _addVariableColumns() {
472
-
473
- $defaults = $this->_getColumnSettings()->getDefaults();
474
-
475
- // EG: Show all (other) needed columns.
476
- $ignoreCols = array(
477
- 'id' => true,
478
- 'websites' => true,
479
- 'status' => true,
480
- 'visibility' => true,
481
- 'qty' => true,
482
- 'price' => true,
483
- 'sku' => true,
484
- 'attribute_set_id' => true,
485
- 'type_id' => true,
486
- 'name' => true,
487
- 'image' => true,
488
- 'thumbnail' => true,
489
- 'small_image' => true,
490
- 'categories' => true
491
- );
492
-
493
-
494
- foreach ($this->columnSettings as $col => $true) {
495
- if ( isset( $ignoreCols[$col] ) ) continue;
496
- if ( isset( $defaults[$col] ) ) {
497
- $innerSettings = $defaults[$col];
498
- } else {
499
- $innerSettings = array(
500
- 'header' => Mage::helper( 'catalog' )->__( $col ),
501
- 'width' => '100px',
502
- 'type' => 'text'
503
- );
504
- }
505
- $innerSettings['index'] = $col;
506
- //echo print_r($this->columnOptions, true);
507
- if ( isset( $this->columnOptions[$col] ) ) {
508
- //die($col);
509
- $innerSettings['type'] = 'options';
510
- $innerSettings['options'] = $this->columnOptions[$col];
511
- }
512
- $this->addColumn( $col, $innerSettings );
513
- }
514
-
515
- return $this;
516
- }
517
-
518
- protected function _prepareMassaction() {
519
- $this->setMassactionIdField( 'entity_id' );
520
- $this->getMassactionBlock()->setFormFieldName( 'product' );
521
-
522
- $this->getMassactionBlock()->addItem( 'delete',
523
- array(
524
- 'label' => Mage::helper( 'catalog' )->__( 'Delete' ),
525
- 'url' => $this->getUrl( '*/*/massDelete' ),
526
- 'confirm' => Mage::helper( 'catalog' )->__( 'Are you sure?' )
527
- ) );
528
-
529
- $statuses = Mage::getSingleton( 'catalog/product_status' )->getOptionArray();
530
-
531
- array_unshift( $statuses, array(
532
- 'label' => '',
533
- 'value' => ''
534
- ) );
535
- $this->getMassactionBlock()->addItem( 'status',
536
- array(
537
- 'label' => Mage::helper( 'catalog' )->__( 'Change status' ),
538
- 'url' => $this->getUrl( '*/*/massStatus', array(
539
- '_current' => true
540
- ) ),
541
- 'additional' => array(
542
- 'visibility' => array(
543
- 'name' => 'status',
544
- 'type' => 'select',
545
- 'class' => 'required-entry',
546
- 'label' => Mage::helper( 'catalog' )->__( 'Status' ),
547
- 'values' => $statuses
548
- )
549
- )
550
- ) );
551
-
552
- $this->getMassactionBlock()->addItem( 'attributes',
553
- array(
554
- 'label' => Mage::helper( 'catalog' )->__( 'Update attributes' ),
555
- 'url' => $this->getUrl( 'adminhtml/catalog_product_action_attribute/edit', array(
556
- '_current' => true
557
- ) )
558
- ) );
559
-
560
- // Divider
561
- $this->getMassactionBlock()->addItem( 'imagesDivider', $this->getMADivider( "Images" ) );
562
-
563
- // Show images...
564
- $imgWidth = Mage::getStoreConfig( 'enhancedgrid/images/width' );
565
- $imgHeight = Mage::getStoreConfig( 'enhancedgrid/images/height' );
566
- $this->getMassactionBlock()->addItem( 'showImages',
567
- array(
568
- 'label' => $this->__( 'Show Selected Images' ),
569
- 'url' => $this->getUrl( 'enhancedgrid/*/index', array(
570
- '_current' => true
571
- ) ),
572
- 'callback' => 'showSelectedImages(productGrid_massactionJsObject, ' . '{checkedValues}, \'<img src=\\\'{imgurl}\\\' width=' .
573
- $imgWidth . ' height=' . $imgHeight . ' border=0 />\')'
574
- )
575
- );
576
- // Hide Images
577
- $this->getMassactionBlock()->addItem( 'hideImages',
578
- array(
579
- 'label' => $this->__( 'Hide Selected Images' ),
580
- 'url' => $this->getUrl( 'enhancedgrid/*/index', array(
581
- '_current' => true
582
- ) ),
583
- 'callback' => 'hideSelectedImages(productGrid_massactionJsObject, {checkedValues})'
584
- )
585
- );
586
-
587
- // Divider 3
588
- $this->getMassactionBlock()->addItem( 'otherDivider', $this->getMADivider( "Other" ) );
589
-
590
- // Opens all products
591
-
592
-
593
- // Refresh...
594
- $this->getMassactionBlock()->addItem( 'refreshProducts',
595
- array(
596
- 'label' => $this->__( 'Refresh Products' ),
597
- 'url' => $this->getUrl( 'enhancedgrid/*/massRefreshProducts', array(
598
- '_current' => true
599
- ) )
600
- ) );
601
-
602
- // $this->getMassactionBlock()->addItem('saveEditables', array(
603
- // 'label' => $this->__('SAVE EDITABLES'),
604
- // 'url' => $this->getUrl('*/*/saveEditables', array('_current'=>true)),
605
- // 'fields' => array('short_description2', '')
606
- // ));
607
-
608
-
609
- return $this;
610
- }
611
-
612
- public function getRowUrl($row) {
613
- //@nelkaake -m 16/11/10: Changed to use _getStore function
614
- return $this->getUrl( 'adminhtml/catalog_product/edit',
615
- array(
616
- 'store' => $this->_getStore(),
617
- 'id' => $row->getId()
618
- ) );
619
- }
620
-
621
- public function getGridUrl() {
622
- return $this->getUrl( 'enhancedgrid/*/grid', array(
623
- '_current' => true
624
- ) );
625
- }
626
-
627
- protected function getMADivider($dividerHeading = "-------") {
628
- $dividerTemplate = array(
629
- 'label' => '--------' . $this->__( $dividerHeading ) . '--------',
630
- 'url' => $this->getUrl( '*/*/index', array(
631
- '_current' => true
632
- ) ),
633
- 'callback' => "null"
634
- );
635
- return $dividerTemplate;
636
- }
637
-
638
- /**
639
- * @nelkaake -a 15/12/10: TODO move this to a decorator class.
640
- */
641
- protected function _preparePage() {
642
- if ( ! $this->getJoinCategories() ) {
643
- return parent::_preparePage();
644
- }
645
-
646
- $this->getCollection()
647
- ->getSelect()
648
- ->reset( Zend_Db_Select::GROUP );
649
-
650
- parent::_preparePage();
651
-
652
- $category_decorator = Mage::getModel( 'enhancedgrid/product_collection_category_decorator' );
653
- $category_decorator->setCollection( $this->getCollection() )
654
- ->addCategories();
655
-
656
- return $this;
657
-
658
- }
659
-
660
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Adminhtml customer grid block.
30
+ *
31
+ * @category Sweet Tooth
32
+ *
33
+ * @author Sweet Tooth <contact@sweettoothrewards.com>
34
+ */
35
+ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
36
+ {
37
+ protected $isenhanced = true;
38
+
39
+ private $columnSettings = array();
40
+ protected $_columnSettings = null;
41
+
42
+ private $columnOptions = array();
43
+
44
+ private $isenabled = true;
45
+
46
+ public function __construct()
47
+ {
48
+ $this->setTemplate('tbt/enhancedgrid/catalog/product/grid.phtml');
49
+ parent::__construct();
50
+ $this->isenabled = Mage::getStoreConfig('enhancedgrid/general/isenabled');
51
+
52
+ $this->setId('productGrid');
53
+
54
+ $this->prepareDefaults();
55
+
56
+ $this->setSaveParametersInSession(true);
57
+ $this->setUseAjax(true);
58
+ $this->setVarNameFilter('product_filter');
59
+
60
+ $this->prepareColumnSettings();
61
+ }
62
+
63
+ protected function prepareDefaults()
64
+ {
65
+ $this->setDefaultLimit(Mage::getStoreConfig('enhancedgrid/defaults/limit'));
66
+ $this->setDefaultPage(Mage::getStoreConfig('enhancedgrid/defaults/page'));
67
+ $this->setDefaultSort(Mage::getStoreConfig('enhancedgrid/defaults/sort'));
68
+ $this->setDefaultDir(Mage::getStoreConfig('enhancedgrid/defaults/dir'));
69
+ }
70
+
71
+ protected function prepareColumnSettings()
72
+ {
73
+ $this->_columnSettings = Mage::getModel('enhancedgrid/product_grid_settings_columns')->setStore($this->_getStore());
74
+ $this->columnSettings = $this->_getColumnSettings()->getColumnSettingsArray();
75
+
76
+ return $this;
77
+ }
78
+
79
+ /**
80
+ * @return TBT_Enhancedgrid_Model_Product_Grid_Settings_Columns
81
+ */
82
+ protected function _getColumnSettings()
83
+ {
84
+ return $this->_columnSettings;
85
+ }
86
+
87
+ public function colIsVisible($code)
88
+ {
89
+ return isset($this->columnSettings[$code]);
90
+ }
91
+
92
+ protected function _isSpecialCol($col)
93
+ {
94
+ return ($col == 'qty' || $col == 'websites' || $col == 'id' || $col == 'categories');
95
+ }
96
+
97
+ protected function _prepareLayout()
98
+ {
99
+ $this->setChild('export_button',
100
+ $this->getLayout()
101
+ ->createBlock('adminhtml/widget_button')
102
+ ->setData(
103
+ array(
104
+ 'label' => Mage::helper('adminhtml')->__('Export'),
105
+ 'onclick' => $this->getJsObjectName().'.doExport()',
106
+ 'class' => 'task',
107
+ )));
108
+ $this->setChild('reset_filter_button',
109
+ $this->getLayout()
110
+ ->createBlock('adminhtml/widget_button')
111
+ ->setData(
112
+ array(
113
+ 'label' => Mage::helper('adminhtml')->__('Reset Filter'),
114
+ 'onclick' => $this->getJsObjectName().'.resetFilter()',
115
+ )));
116
+ $this->setChild('search_button',
117
+ $this->getLayout()
118
+ ->createBlock('adminhtml/widget_button')
119
+ ->setData(
120
+ array(
121
+ 'label' => Mage::helper('adminhtml')->__('Search'),
122
+ 'onclick' => $this->getJsObjectName().'.doFilter()',
123
+ 'class' => 'task',
124
+ )));
125
+
126
+ return parent::_prepareLayout();
127
+ }
128
+
129
+ public function getQueryStr()
130
+ {
131
+ return urldecode($this->getParam('q'));
132
+ }
133
+
134
+ /**
135
+ * get collection object
136
+ * //@nelkaake -a 13/11/10: this is just here for the codeassist function.
137
+ *
138
+ * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
139
+ */
140
+ public function getCollection()
141
+ {
142
+ return parent::getCollection();
143
+ }
144
+
145
+ protected function _prepareCollection()
146
+ {
147
+ $collection = $this->getCollection();
148
+ //@nelkaake -m 13/11/10: Just made it a little nicer
149
+ $queryString = $this->getQueryStr();
150
+ if ($queryString) {
151
+ $collection = Mage::helper('enhancedgrid')->getSearchCollection($queryString, $this->getRequest());
152
+ }
153
+
154
+ if (!$collection) {
155
+ //@nelkaake -a 15/12/10: To fix categories column issue this is a tempoary way we are going to load the modified collection class.
156
+ $collection = new TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection();
157
+ }
158
+ $store = $this->_getStore();
159
+ $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');
160
+ $collection->addAttributeToSelect('sku');
161
+
162
+ //$collection->addAttributeToSelect('attribute_set_id');
163
+ //$collection->addAttributeToSelect('type_id');
164
+
165
+
166
+ if ($store->getId()) {
167
+ //$collection->setStoreId($store->getId());
168
+ $collection->addStoreFilter($store->getId());
169
+ $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());
170
+ $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());
171
+ $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());
172
+ $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());
173
+ } else {
174
+ $collection->addAttributeToSelect('price');
175
+ $collection->addAttributeToSelect('status');
176
+ $collection->addAttributeToSelect('visibility');
177
+ }
178
+ // EG: Select all needed columns.
179
+ //id,name,type,attribute_set,sku,price,qty,visibility,status,websites,image
180
+ foreach ($this->columnSettings as $col => $true) {
181
+ if ($this->_isSpecialCol($col)) {
182
+ continue;
183
+ }
184
+ $collection->addAttributeToSelect($col);
185
+ }
186
+
187
+ if ($this->colIsVisible('categories')) {
188
+ $this->setJoinCategories(true);
189
+ }
190
+
191
+ $this->setCollection($collection);
192
+
193
+ $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
194
+ $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('XML'));
195
+
196
+ parent::_prepareCollection();
197
+ $collection->addWebsiteNamesToResult();
198
+
199
+ return $this;
200
+ }
201
+
202
+ /**
203
+ * if the attribute has options an options entry will be
204
+ * added to $columnOptions.
205
+ */
206
+ protected function loadColumnOptions($attr_code)
207
+ {
208
+ $attr = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attr_code);
209
+ if (sizeof($attr->getData()) > 0) {
210
+ if ($attr->getFrontendInput() == 'select') {
211
+ //@nelkaake -a 13/11/10:
212
+ if ($attr->getSourceModel() != null) {
213
+ $sourcemodel = Mage::getModel($attr->getSourceModel());
214
+ //@nelkaake -a 16/11/10:
215
+ $sourcemodel->setAttribute($attr);
216
+ if (method_exists($sourcemodel, 'getAllOptions')) {
217
+ try {
218
+ //die($attr->getSourceModel());
219
+ $values = $sourcemodel->getAllOptions();
220
+
221
+ $options = array();
222
+
223
+ foreach ($values as $value) {
224
+ $options[$value['value']] = $value['label'];
225
+ }
226
+ //die($attr_code);
227
+ $this->columnOptions[$attr_code] = $options;
228
+
229
+ return;
230
+ } catch (Exception $e) {
231
+ Mage::log(
232
+ "Tried to get options for {$attr_code} using getAllOptions on {$attr->getSourceModel()}, but an exception occured: ".
233
+ (string) $e);
234
+ }
235
+ }
236
+ }
237
+ //@nelkaake -a 13/11/10:
238
+ $values = Mage::getResourceModel('eav/entity_attribute_option_collection')->setAttributeFilter(
239
+ $attr->getId())
240
+ ->setStoreFilter($this->_getStore()
241
+ ->getId(), false)
242
+ ->load();
243
+ $options = array();
244
+ foreach ($values as $value) {
245
+ $options[$value->getOptionId()] = $value->getValue();
246
+ }
247
+ //die($attr_code);
248
+ $this->columnOptions[$attr_code] = $options;
249
+
250
+ //die(print_r($this->columnOptions, true));
251
+ }
252
+ }
253
+ }
254
+
255
+ protected function _getStore()
256
+ {
257
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
258
+ $store = Mage::app()->getStore($storeId);
259
+ if ($store->getId() != $storeId) {
260
+ $store = Mage::app()->getStore(0);
261
+ }
262
+
263
+ return $store;
264
+ }
265
+
266
+ protected function _addColumnFilterToCollection($column)
267
+ {
268
+ if ($this->getCollection()) {
269
+ if ($column->getId() == 'websites') {
270
+ $this->getCollection()->joinField('websites', 'catalog/product_website', 'website_id', 'product_id=entity_id', null,
271
+ 'left');
272
+ }
273
+ }
274
+
275
+ return parent::_addColumnFilterToCollection($column);
276
+ }
277
+
278
+ protected function _prepareColumns()
279
+ {
280
+ // Loads all the column options for each applicable column.
281
+ foreach ($this->columnSettings as $col => $true) {
282
+ $this->loadColumnOptions($col);
283
+ }
284
+
285
+ $store = $this->_getStore();
286
+ if ($this->colIsVisible('id')) {
287
+ $this->addColumn('id',
288
+ array(
289
+ 'header' => Mage::helper('catalog')->__('ID'),
290
+ 'width' => '50px',
291
+ 'type' => 'number',
292
+ 'index' => 'entity_id',
293
+ ));
294
+ }
295
+
296
+ $imgWidth = Mage::getStoreConfig('enhancedgrid/images/width') + 'px';
297
+
298
+ if ($this->colIsVisible('thumbnail')) {
299
+ $this->addColumn('thumbnail',
300
+ array(
301
+ 'header' => Mage::helper('catalog')->__('Thumbnail'),
302
+ 'type' => 'image',
303
+ 'width' => $imgWidth,
304
+ 'index' => 'thumbnail',
305
+ ));
306
+ }
307
+ if ($this->colIsVisible('small_image')) {
308
+ $this->addColumn('small_image',
309
+ array(
310
+ 'header' => Mage::helper('catalog')->__('Small Img'),
311
+ 'type' => 'image',
312
+ 'width' => $imgWidth,
313
+ 'index' => 'small_image',
314
+ ));
315
+ }
316
+ if ($this->colIsVisible('image')) {
317
+ $this->addColumn('image',
318
+ array(
319
+ 'header' => Mage::helper('catalog')->__('Image'),
320
+ 'type' => 'image',
321
+ 'width' => $imgWidth,
322
+ 'index' => 'image',
323
+ ));
324
+ }
325
+
326
+ if ($this->colIsVisible('name')) {
327
+ $this->addColumn('name',
328
+ array(
329
+ 'header' => Mage::helper('catalog')->__('Name'),
330
+ 'index' => 'name',
331
+ )// 'width' => '150px'
332
+ );
333
+ }
334
+ if ($this->colIsVisible('name')) {
335
+ if ($store->getId()) {
336
+ $this->addColumn('custom_name',
337
+ array(
338
+ 'header' => Mage::helper('catalog')->__('Name In %s', $store->getName()),
339
+ 'index' => 'custom_name',
340
+ 'width' => '150px',
341
+ ));
342
+ }
343
+ }
344
+
345
+ if ($this->colIsVisible('type_id')) {
346
+ $this->addColumn('type',
347
+ array(
348
+ 'header' => Mage::helper('catalog')->__('Type'),
349
+ 'width' => '60px',
350
+ 'index' => 'type_id',
351
+ 'type' => 'options',
352
+ 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
353
+ ));
354
+ }
355
+
356
+ if ($this->colIsVisible('attribute_set_id')) {
357
+ $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')->setEntityTypeFilter(
358
+ Mage::getModel('catalog/product')->getResource()
359
+ ->getTypeId())
360
+ ->load()
361
+ ->toOptionHash();
362
+
363
+ $this->addColumn('set_name',
364
+ array(
365
+ 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),
366
+ 'width' => '100px',
367
+ 'index' => 'attribute_set_id',
368
+ 'type' => 'options',
369
+ 'options' => $sets,
370
+ ));
371
+ }
372
+
373
+ if ($this->colIsVisible('sku')) {
374
+ $this->addColumn('sku',
375
+ array(
376
+ 'header' => Mage::helper('catalog')->__('SKU'),
377
+ 'width' => '80px',
378
+ 'index' => 'sku',
379
+ ));
380
+ }
381
+
382
+ if ($this->colIsVisible('price')) {
383
+ $this->addColumn('price',
384
+ array(
385
+ 'header' => Mage::helper('catalog')->__('Price'),
386
+ 'type' => 'price',
387
+ 'currency_code' => $store->getBaseCurrency()
388
+ ->getCode(),
389
+ 'index' => 'price',
390
+ ));
391
+ }
392
+
393
+ if ($this->colIsVisible('qty')) {
394
+ $this->addColumn('qty',
395
+ array(
396
+ 'header' => Mage::helper('catalog')->__('Qty'),
397
+ 'width' => '100px',
398
+ 'type' => 'number',
399
+ 'index' => 'qty',
400
+ ));
401
+ }
402
+
403
+ if ($this->colIsVisible('visibility')) {
404
+ $this->addColumn('visibility',
405
+ array(
406
+ 'header' => Mage::helper('catalog')->__('Visibility'),
407
+ 'width' => '70px',
408
+ 'index' => 'visibility',
409
+ 'type' => 'options',
410
+ 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
411
+ ));
412
+ }
413
+
414
+ if ($this->colIsVisible('status')) {
415
+ $this->addColumn('status',
416
+ array(
417
+ 'header' => Mage::helper('catalog')->__('Status'),
418
+ 'width' => '70px',
419
+ 'index' => 'status',
420
+ 'type' => 'options',
421
+ 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
422
+ ));
423
+ }
424
+
425
+ if ($this->colIsVisible('websites')) {
426
+ if (!Mage::app()->isSingleStoreMode()) {
427
+ $this->addColumn('websites',
428
+ array(
429
+ 'header' => Mage::helper('catalog')->__('Websites'),
430
+ 'width' => '100px',
431
+ 'sortable' => false,
432
+ 'index' => 'websites',
433
+ 'type' => 'options',
434
+ 'options' => Mage::getModel('core/website')->getCollection()
435
+ ->toOptionHash(),
436
+ ));
437
+ }
438
+ }
439
+
440
+ if ($this->colIsVisible('categories')) {
441
+ $this->addColumn('categories',
442
+ array(
443
+ 'header' => Mage::helper('catalog')->__('Categories'),
444
+ 'width' => '100px',
445
+ 'sortable' => true,
446
+ 'index' => 'categories',
447
+ 'sort_index' => 'category',
448
+ 'filter_index' => 'category',
449
+ ));
450
+ }
451
+
452
+ $this->_addVariableColumns();
453
+
454
+ $this->addColumn('action',
455
+ array(
456
+ 'header' => Mage::helper('catalog')->__('Action'),
457
+ 'width' => '50px',
458
+ 'type' => 'action',
459
+ 'getter' => 'getId',
460
+ 'actions' => array(
461
+ array(
462
+ 'caption' => Mage::helper('catalog')->__('Edit'),
463
+ 'id' => 'editlink',
464
+ 'url' => array(
465
+ 'base' => 'adminhtml/*/edit',
466
+ 'params' => array(
467
+ 'store' => $this->getRequest()
468
+ ->getParam('store'),
469
+ ),
470
+ ),
471
+ 'field' => 'id',
472
+ ),
473
+ ),
474
+ 'filter' => false,
475
+ 'sortable' => false,
476
+ 'index' => 'stores',
477
+ ));
478
+
479
+ $this->addRssList('rss/catalog/notifystock', Mage::helper('catalog')->__('Notify Low Stock RSS'));
480
+
481
+ return parent::_prepareColumns();
482
+ }
483
+
484
+ /**
485
+ * Adds all the columns that are not part of the fixed configuration settings prepared above.
486
+ */
487
+ protected function _addVariableColumns()
488
+ {
489
+ $defaults = $this->_getColumnSettings()->getDefaults();
490
+
491
+ // EG: Show all (other) needed columns.
492
+ $ignoreCols = array(
493
+ 'id' => true,
494
+ 'websites' => true,
495
+ 'status' => true,
496
+ 'visibility' => true,
497
+ 'qty' => true,
498
+ 'price' => true,
499
+ 'sku' => true,
500
+ 'attribute_set_id' => true,
501
+ 'type_id' => true,
502
+ 'name' => true,
503
+ 'image' => true,
504
+ 'thumbnail' => true,
505
+ 'small_image' => true,
506
+ 'categories' => true,
507
+ );
508
+
509
+ foreach ($this->columnSettings as $col => $true) {
510
+ if (isset($ignoreCols[$col])) {
511
+ continue;
512
+ }
513
+ if (isset($defaults[$col])) {
514
+ $innerSettings = $defaults[$col];
515
+ } else {
516
+ $innerSettings = array(
517
+ 'header' => Mage::helper('catalog')->__($col),
518
+ 'width' => '100px',
519
+ 'type' => 'text',
520
+ );
521
+ }
522
+ $innerSettings['index'] = $col;
523
+ //echo print_r($this->columnOptions, true);
524
+ if (isset($this->columnOptions[$col])) {
525
+ //die($col);
526
+ $innerSettings['type'] = 'options';
527
+ $innerSettings['options'] = $this->columnOptions[$col];
528
+ }
529
+ $this->addColumn($col, $innerSettings);
530
+ }
531
+
532
+ return $this;
533
+ }
534
+
535
+ protected function _prepareMassaction()
536
+ {
537
+ $this->setMassactionIdField('entity_id');
538
+ $this->getMassactionBlock()->setFormFieldName('product');
539
+
540
+ $this->getMassactionBlock()->addItem('delete',
541
+ array(
542
+ 'label' => Mage::helper('catalog')->__('Delete'),
543
+ 'url' => $this->getUrl('*/*/massDelete'),
544
+ 'confirm' => Mage::helper('catalog')->__('Are you sure?'),
545
+ ));
546
+
547
+ $statuses = Mage::getSingleton('catalog/product_status')->getOptionArray();
548
+
549
+ array_unshift($statuses, array(
550
+ 'label' => '',
551
+ 'value' => '',
552
+ ));
553
+ $this->getMassactionBlock()->addItem('status',
554
+ array(
555
+ 'label' => Mage::helper('catalog')->__('Change status'),
556
+ 'url' => $this->getUrl('*/*/massStatus', array(
557
+ '_current' => true,
558
+ )),
559
+ 'additional' => array(
560
+ 'visibility' => array(
561
+ 'name' => 'status',
562
+ 'type' => 'select',
563
+ 'class' => 'required-entry',
564
+ 'label' => Mage::helper('catalog')->__('Status'),
565
+ 'values' => $statuses,
566
+ ),
567
+ ),
568
+ ));
569
+
570
+ $this->getMassactionBlock()->addItem('attributes',
571
+ array(
572
+ 'label' => Mage::helper('catalog')->__('Update attributes'),
573
+ 'url' => $this->getUrl('adminhtml/catalog_product_action_attribute/edit', array(
574
+ '_current' => true,
575
+ )),
576
+ ));
577
+
578
+ // Divider
579
+ $this->getMassactionBlock()->addItem('imagesDivider', $this->getMADivider('Images'));
580
+
581
+ // Show images...
582
+ $imgWidth = Mage::getStoreConfig('enhancedgrid/images/width');
583
+ $imgHeight = Mage::getStoreConfig('enhancedgrid/images/height');
584
+ $this->getMassactionBlock()->addItem('showImages',
585
+ array(
586
+ 'label' => $this->__('Show Selected Images'),
587
+ 'url' => $this->getUrl('enhancedgrid/*/index', array(
588
+ '_current' => true,
589
+ )),
590
+ 'callback' => 'showSelectedImages(productGrid_massactionJsObject, '.'{checkedValues}, \'<img src=\\\'{imgurl}\\\' width='.
591
+ $imgWidth.' height='.$imgHeight.' border=0 />\')',
592
+ )
593
+ );
594
+ // Hide Images
595
+ $this->getMassactionBlock()->addItem('hideImages',
596
+ array(
597
+ 'label' => $this->__('Hide Selected Images'),
598
+ 'url' => $this->getUrl('enhancedgrid/*/index', array(
599
+ '_current' => true,
600
+ )),
601
+ 'callback' => 'hideSelectedImages(productGrid_massactionJsObject, {checkedValues})',
602
+ )
603
+ );
604
+
605
+ // Divider 3
606
+ $this->getMassactionBlock()->addItem('otherDivider', $this->getMADivider('Other'));
607
+
608
+ // Opens all products
609
+
610
+
611
+ // Refresh...
612
+ $this->getMassactionBlock()->addItem('refreshProducts',
613
+ array(
614
+ 'label' => $this->__('Refresh Products'),
615
+ 'url' => $this->getUrl('enhancedgrid/*/massRefreshProducts', array(
616
+ '_current' => true,
617
+ )),
618
+ ));
619
+
620
+ // $this->getMassactionBlock()->addItem('saveEditables', array(
621
+ // 'label' => $this->__('SAVE EDITABLES'),
622
+ // 'url' => $this->getUrl('*/*/saveEditables', array('_current'=>true)),
623
+ // 'fields' => array('short_description2', '')
624
+ // ));
625
+
626
+
627
+ return $this;
628
+ }
629
+
630
+ public function getRowUrl($row)
631
+ {
632
+ //@nelkaake -m 16/11/10: Changed to use _getStore function
633
+ return $this->getUrl('adminhtml/catalog_product/edit',
634
+ array(
635
+ 'store' => $this->_getStore(),
636
+ 'id' => $row->getId(),
637
+ ));
638
+ }
639
+
640
+ public function getGridUrl()
641
+ {
642
+ return $this->getUrl('adminhtml/*/grid', array(
643
+ '_current' => true,
644
+ ));
645
+ }
646
+
647
+ protected function getMADivider($dividerHeading = '-------')
648
+ {
649
+ $dividerTemplate = array(
650
+ 'label' => '--------'.$this->__($dividerHeading).'--------',
651
+ 'url' => $this->getUrl('*/*/index', array(
652
+ '_current' => true,
653
+ )),
654
+ 'callback' => 'null',
655
+ );
656
+
657
+ return $dividerTemplate;
658
+ }
659
+
660
+ /**
661
+ * @nelkaake -a 15/12/10: TODO move this to a decorator class.
662
+ */
663
+ protected function _preparePage()
664
+ {
665
+ if (!$this->getJoinCategories()) {
666
+ return parent::_preparePage();
667
+ }
668
+
669
+ $this->getCollection()
670
+ ->getSelect()
671
+ ->reset(Zend_Db_Select::GROUP);
672
+
673
+ parent::_preparePage();
674
+
675
+ $category_decorator = Mage::getModel('enhancedgrid/product_collection_category_decorator');
676
+ $category_decorator->setCollection($this->getCollection())
677
+ ->addCategories();
678
+
679
+ return $this;
680
+ }
681
+ }
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid/Columns.php CHANGED
@@ -1 +1 @@
1
- <?php
1
+ <?php
app/code/community/TBT/Enhancedgrid/Block/System/Html.php CHANGED
@@ -1,92 +1,92 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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
- class TBT_Enhancedgrid_Block_System_Html
29
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
30
- {
31
- protected $_dummyElement;
32
- protected $_fieldRenderer;
33
- protected $_values;
34
-
35
- public function render(Varien_Data_Form_Element_Abstract $element)
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
- $html .= Mage::getBlockSingleton('enhancedgrid/widget_loyalty')->toHtml();
44
- $html .= "
45
- </div>
46
- ";
47
- $html .= "";//$this->_getFooterHtml($element);
48
-
49
- return $html;
50
- }
51
-
52
- protected function _getDummyElement()
53
- {
54
- if (empty($this->_dummyElement)) {
55
- $this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
56
- }
57
- return $this->_dummyElement;
58
- }
59
-
60
- protected function _getFieldRenderer()
61
- {
62
- if (empty($this->_fieldRenderer)) {
63
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
64
- }
65
- return $this->_fieldRenderer;
66
- }
67
-
68
- protected function _getFieldHtml($fieldset, $moduleName)
69
- {
70
- $configData = $this->getConfigData();
71
- $path = 'advanced/modules_disable_output/'.$moduleName; //TODO: move as property of form
72
- $data = isset($configData[$path]) ? $configData[$path] : array();
73
-
74
- $e = $this->_getDummyElement();
75
-
76
- $moduleKey = substr($moduleName, strpos($moduleName,'_')+1);
77
- $ver = (Mage::getConfig()->getModuleConfig($moduleName)->version);
78
-
79
-
80
- if($ver){
81
- $field = $fieldset->addField($moduleName, 'label',
82
- array(
83
- 'name' => 'unused',
84
- 'label' => $moduleName,
85
- 'value' => $ver
86
- ))->setRenderer($this->_getFieldRenderer());
87
- return $field->toHtml();
88
- }
89
- return '';
90
-
91
- }
92
- }
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2010 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class TBT_Enhancedgrid_Block_System_Html
28
+ extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
29
+ {
30
+ protected $_dummyElement;
31
+ protected $_fieldRenderer;
32
+ protected $_values;
33
+
34
+ public function render(Varien_Data_Form_Element_Abstract $element)
35
+ {
36
+ $html = '';
37
+ $html .= '
38
+ <div style=" margin-bottom: 12px; width: 430px;">
39
+ Enhanced Grid v'.Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version').". <a href='https://github.com/jayelkaake/enhancedgrid' target='_blank'>Click here for updates.</a><BR />
40
+ ";
41
+ $html .= Mage::getBlockSingleton('enhancedgrid/widget_loyalty')->toHtml();
42
+ $html .= '
43
+ </div>
44
+ ';
45
+ $html .= '';//$this->_getFooterHtml($element);
46
+
47
+ return $html;
48
+ }
49
+
50
+ protected function _getDummyElement()
51
+ {
52
+ if (empty($this->_dummyElement)) {
53
+ $this->_dummyElement = new Varien_Object(array('show_in_default' => 1, 'show_in_website' => 1));
54
+ }
55
+
56
+ return $this->_dummyElement;
57
+ }
58
+
59
+ protected function _getFieldRenderer()
60
+ {
61
+ if (empty($this->_fieldRenderer)) {
62
+ $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
63
+ }
64
+
65
+ return $this->_fieldRenderer;
66
+ }
67
+
68
+ protected function _getFieldHtml($fieldset, $moduleName)
69
+ {
70
+ $configData = $this->getConfigData();
71
+ $path = 'advanced/modules_disable_output/'.$moduleName; //TODO: move as property of form
72
+ $data = isset($configData[$path]) ? $configData[$path] : array();
73
+
74
+ $e = $this->_getDummyElement();
75
+
76
+ $moduleKey = substr($moduleName, strpos($moduleName, '_') + 1);
77
+ $ver = (Mage::getConfig()->getModuleConfig($moduleName)->version);
78
+
79
+ if ($ver) {
80
+ $field = $fieldset->addField($moduleName, 'label',
81
+ array(
82
+ 'name' => 'unused',
83
+ 'label' => $moduleName,
84
+ 'value' => $ver,
85
+ ))->setRenderer($this->_getFieldRenderer());
86
+
87
+ return $field->toHtml();
88
+ }
89
+
90
+ return '';
91
+ }
92
+ }
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Magento
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -12,23 +12,25 @@
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 Mage
25
- * @package TBT_MassRelater
26
- * @author Magento Core Team <core@magentocommerce.com>
27
  */
28
  class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column
29
  {
30
-
31
-
32
  protected function _getRendererByType()
33
  {
34
  switch (strtolower($this->getType())) {
@@ -42,6 +44,7 @@ class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Wid
42
  $rendererClass = parent::_getRendererByType();
43
  break;
44
  }
 
45
  return $rendererClass;
46
  }
47
 
@@ -55,7 +58,7 @@ class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Wid
55
  $filterClass = parent::_getFilterByType();
56
  break;
57
  }
 
58
  return $filterClass;
59
  }
60
-
61
- }
1
  <?php
2
  /**
3
+ * Sweet Tooth.
4
  *
5
  * NOTICE OF LICENSE
6
  *
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
26
  /**
27
+ * Grid column block.
28
  *
29
+ * @category Sweet Tooth
30
+ * @author Jay El-Kaake <jay@sweettoothhq.com>
 
31
  */
32
  class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column
33
  {
 
 
34
  protected function _getRendererByType()
35
  {
36
  switch (strtolower($this->getType())) {
44
  $rendererClass = parent::_getRendererByType();
45
  break;
46
  }
47
+
48
  return $rendererClass;
49
  }
50
 
58
  $filterClass = parent::_getFilterByType();
59
  break;
60
  }
61
+
62
  return $filterClass;
63
  }
64
+ }
 
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Category.php CHANGED
@@ -1,39 +1,34 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
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
- * @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
- {
37
-
38
-
39
- }
1
+ <?php
2
+ /**
3
+ * Sweet Tooth.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /**
27
+ * Store grid column filter.
28
+ *
29
+ * @category Sweet Tooth
30
+ * @author Jay El-Kaake <jay@sweettoothhq.com>
31
+ */
32
+ class TBT_Rewards_Block_Widget_Grid_Column_Filter_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
33
+ {
34
+ }
 
 
 
 
 
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Image.php CHANGED
@@ -1,31 +1,34 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * Checkbox grid column filter
23
- *
24
- * @category Mage
25
- * @package TBT_MassRelater
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
29
- {
30
-
31
- }
 
 
 
1
+ <?php
2
+ /**
3
+ * Sweet Tooth.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /**
27
+ * Checkbox grid column filter.
28
+ *
29
+ * @category Sweet Tooth
30
+ * @author Jay El-Kaake <jay@sweettoothhq.com>
31
+ */
32
+ class TBT_Enhancedgrid_Block_Widget_Grid_Column_Filter_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
33
+ {
34
+ }
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Action.php CHANGED
@@ -1,77 +1,83 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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 widget for rendering action grid cells
23
- *
24
- * @category Mage
25
- * @package TBT_MassRelater
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
- {
30
-
31
- /**
32
- * Prepares action data for html render
33
- *
34
- * @param array $action
35
- * @param string $actionCaption
36
- * @param Varien_Object $row
37
- * @return Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
38
- */
39
- protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row)
40
- {
41
- foreach ( $action as $attibute => $value ) {
42
- if(isset($action[$attibute]) && !is_array($action[$attibute])) {
43
- $this->getColumn()->setFormat($action[$attibute]);
44
- $action[$attibute] = parent::render($row);
45
- } else {
46
- $this->getColumn()->setFormat(null);
47
- }
48
-
49
- switch ($attibute) {
50
- case 'caption':
51
- $actionCaption = $action['caption'];
52
- unset($action['caption']);
53
- break;
54
-
55
- case 'url':
56
- if(is_array($action['url'])) {
57
- $params = array($action['field']=>$this->_getValue($row));
58
- if(isset($action['url']['params'])) {
59
- $params = array_merge($action['url']['params'], $params);
60
- }
61
- $action['href'] = $this->getUrl($action['url']['base'], $params);
62
- unset($action['field']);
63
- } else {
64
- $action['href'] = $action['url'];
65
- }
66
- unset($action['url']);
67
- break;
68
-
69
- case 'popup':
70
- $action['onclick'] = 'popWin(this.href, \'windth=800,height=700,resizable=1,scrollbars=1\');return false;';
71
- break;
72
-
73
- }
74
- }
75
- return $this;
76
- }
77
- }
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sweet Tooth.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Grid column widget for rendering action grid cells.
29
+ *
30
+ * @category Sweet Tooth
31
+ * @author Jay El-Kaake <jay@sweettoothhq.com>
32
+ */
33
+ class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
34
+ {
35
+ /**
36
+ * Prepares action data for html render.
37
+ *
38
+ * @param array $action
39
+ * @param string $actionCaption
40
+ * @param Varien_Object $row
41
+ *
42
+ * @return Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
43
+ */
44
+ protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row)
45
+ {
46
+ foreach ($action as $attibute => $value) {
47
+ if (isset($action[$attibute]) && !is_array($action[$attibute])) {
48
+ $this->getColumn()->setFormat($action[$attibute]);
49
+ $action[$attibute] = parent::render($row);
50
+ } else {
51
+ $this->getColumn()->setFormat(null);
52
+ }
53
+
54
+ switch ($attibute) {
55
+ case 'caption':
56
+ $actionCaption = $action['caption'];
57
+ unset($action['caption']);
58
+ break;
59
+
60
+ case 'url':
61
+ if (is_array($action['url'])) {
62
+ $params = array($action['field'] => $this->_getValue($row));
63
+ if (isset($action['url']['params'])) {
64
+ $params = array_merge($action['url']['params'], $params);
65
+ }
66
+ $action['href'] = $this->getUrl($action['url']['base'], $params);
67
+ unset($action['field']);
68
+ } else {
69
+ $action['href'] = $action['url'];
70
+ }
71
+ unset($action['url']);
72
+ break;
73
+
74
+ case 'popup':
75
+ $action['onclick'] = 'popWin(this.href, \'windth=800,height=700,resizable=1,scrollbars=1\');return false;';
76
+ break;
77
+
78
+ }
79
+ }
80
+
81
+ return $this;
82
+ }
83
+ }
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Category.php CHANGED
@@ -1,87 +1,86 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
-
21
- /**
22
- * Grid checkbox column renderer
23
- *
24
- * @category WDCA
25
- * @package TBT_Enhancedgrid
26
- * @author WDCA <contact@wdca.ca>
27
- */
28
- class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
29
- {
30
- protected static $cat_map = null;
31
-
32
- public function __construct() {
33
- return parent::_construct();
34
- }
35
-
36
- /**
37
- * Renders grid column
38
- *
39
- * @param Varien_Object $row
40
- * @return string
41
- */
42
- public function render(Varien_Object $row)
43
- {
44
-
45
- return $this->_getValue($row);
46
- }
47
-
48
- /*
49
- public function renderProperty(Varien_Object $row)
50
- {
51
- $val = $row->getData($this->getColumn()->getIndex());
52
- $val = Mage::helper('imagebyurl')->getImageUrl($val);
53
- $out = parent::renderProperty(). ' onclick="showImage('.$val.')" ';
54
- return $out;
55
- }
56
-
57
- */
58
- protected function _getValue(Varien_Object $row)
59
- {
60
-
61
- if ($getter = $this->getColumn()->getGetter()) {
62
- $val = $row->$getter();
63
- }
64
- if(self::$cat_map == null) {
65
- $cat_col = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('name');
66
- $cat_map = array();
67
- foreach($cat_col as &$c) {
68
- $cat_map[$c->getId()] = $c->getName();
69
- }
70
- self::$cat_map = $cat_map;
71
- }
72
- $category_ids_str = $row->getData('category_ids');
73
- $category_ids = explode(",", $category_ids_str);
74
-
75
- $cat_names = array();
76
- foreach(self::$cat_map as $id=>$name) {
77
- if(array_search($id, $category_ids) !== false) {
78
- $cat_names[] = $name;
79
- }
80
- }
81
- $cat_names_str = implode(",", $cat_names);
82
-
83
- return $cat_names_str;
84
- }
85
-
86
-
87
- }
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Sweet Tooth
17
+ *
18
+ * @copyright Copyright (c) 2008-2010 Sweet Tooth (http://www.sweettoothrewards.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Grid checkbox column renderer.
24
+ *
25
+ * @category Sweet Tooth
26
+ *
27
+ * @author Sweet Tooth <contact@sweettoothrewards.com>
28
+ */
29
+ class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
30
+ {
31
+ protected static $cat_map = null;
32
+
33
+ public function __construct()
34
+ {
35
+ return parent::_construct();
36
+ }
37
+
38
+ /**
39
+ * Renders grid column.
40
+ *
41
+ * @param Varien_Object $row
42
+ *
43
+ * @return string
44
+ */
45
+ public function render(Varien_Object $row)
46
+ {
47
+ return $this->_getValue($row);
48
+ }
49
+
50
+ /*
51
+ public function renderProperty(Varien_Object $row)
52
+ {
53
+ $val = $row->getData($this->getColumn()->getIndex());
54
+ $val = Mage::helper('imagebyurl')->getImageUrl($val);
55
+ $out = parent::renderProperty(). ' onclick="showImage('.$val.')" ';
56
+ return $out;
57
+ }
58
+
59
+ */
60
+ protected function _getValue(Varien_Object $row)
61
+ {
62
+ if ($getter = $this->getColumn()->getGetter()) {
63
+ $val = $row->$getter();
64
+ }
65
+ if (self::$cat_map == null) {
66
+ $cat_col = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('name');
67
+ $cat_map = array();
68
+ foreach ($cat_col as &$c) {
69
+ $cat_map[$c->getId()] = $c->getName();
70
+ }
71
+ self::$cat_map = $cat_map;
72
+ }
73
+ $category_ids_str = $row->getData('category_ids');
74
+ $category_ids = explode(',', $category_ids_str);
75
+
76
+ $cat_names = array();
77
+ foreach (self::$cat_map as $id => $name) {
78
+ if (array_search($id, $category_ids) !== false) {
79
+ $cat_names[] = $name;
80
+ }
81
+ }
82
+ $cat_names_str = implode(',', $cat_names);
83
+
84
+ return $cat_names_str;
85
+ }
86
+ }
 
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Image.php CHANGED
@@ -1,117 +1,122 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
-
21
- /**
22
- * Grid checkbox column renderer
23
- *
24
- * @category WDCA
25
- * @package TBT_Enhancedgrid
26
- * @author WDCA <contact@wdca.ca>
27
- */
28
- class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
29
- {
30
- protected static $showImagesUrl = null;
31
- protected static $showByDefault = null;
32
- protected static $width = null;
33
- protected static $height = null;
34
-
35
- public function __construct() {
36
- if(self::$showImagesUrl == null)
37
- self::$showImagesUrl = (int)Mage::getStoreConfig('enhancedgrid/images/showurl') === 1;
38
- if(self::$showByDefault == null)
39
- self::$showByDefault = (int)Mage::getStoreConfig('enhancedgrid/images/showbydefault') === 1;
40
- if(self::$width == null)
41
- self::$width = Mage::getStoreConfig('enhancedgrid/images/width');
42
- if(self::$height == null)
43
- self::$height = Mage::getStoreConfig('enhancedgrid/images/height');
44
- }
45
-
46
- /**
47
- * Renders grid column
48
- *
49
- * @param Varien_Object $row
50
- * @return string
51
- */
52
- public function render(Varien_Object $row)
53
- {
54
-
55
- return $this->_getValue($row);
56
- }
57
-
58
- /*
59
- public function renderProperty(Varien_Object $row)
60
- {
61
- $val = $row->getData($this->getColumn()->getIndex());
62
- $val = Mage::helper('imagebyurl')->getImageUrl($val);
63
- $out = parent::renderProperty(). ' onclick="showImage('.$val.')" ';
64
- return $out;
65
- }
66
-
67
- */
68
- protected function _getValue(Varien_Object $row)
69
- {
70
-
71
- $dored = false;
72
- if ($getter = $this->getColumn()->getGetter()) {
73
- $val = $row->$getter();
74
- }
75
- $val = $val2 = $row->getData($this->getColumn()->getIndex());
76
- $val = str_replace("no_selection", "", $val);
77
- $val2 = str_replace("no_selection", "", $val2);
78
- $url = Mage::helper('enhancedgrid')->getImageUrl($val);
79
-
80
- if(!Mage::helper('enhancedgrid')->getFileExists($val)) {
81
- $dored =true;
82
- $val .= "[!]";
83
- }
84
- if(strpos($val, "placeholder/")) {
85
- $dored = true;
86
- }
87
-
88
- $filename = substr($val2, strrpos($val2, "/")+1, strlen($val2)-strrpos($val2, "/")-1);
89
- if(!self::$showImagesUrl) $filename = '';
90
- if($dored) {
91
- $val = "<span style=\"color:red\" id=\"img\">$filename</span>";
92
- } else {
93
- $val = "<span>". $filename ."</span>";
94
- }
95
-
96
- if(empty($val2) ) {
97
- $out = "<center>" . $this->__("(no image)") . "</center>";
98
- } else {
99
- $out = $val. '<center><a href="#" onclick="window.open(\''. $url .'\', \''. $val2 .'\')"'.
100
- 'title="'. $val2 .'" '. ' url="'.$url.'" id="imageurl">';
101
- }
102
-
103
- if(self::$showByDefault && !empty($val2) ) {
104
- $out .= "<img src=". $url ." width='". self::$width ."' ";
105
- if(self::$height > self::$width) {
106
- $out .= "height='". self::$height ."' ";
107
- }
108
- $out .=" />";
109
- }
110
- //die( $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135));
111
- $out .= '</a></center>';
112
-
113
- return $out;
114
- }
115
-
116
-
117
- }
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Sweet Tooth
17
+ *
18
+ * @copyright Copyright (c) 2008-2010 Sweet Tooth (http://www.sweettoothrewards.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Grid checkbox column renderer.
24
+ *
25
+ * @category Sweet Tooth
26
+ *
27
+ * @author Sweet Tooth <contact@sweettoothrewards.com>
28
+ */
29
+ class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
30
+ {
31
+ protected static $showImagesUrl = null;
32
+ protected static $showByDefault = null;
33
+ protected static $width = null;
34
+ protected static $height = null;
35
+
36
+ public function __construct()
37
+ {
38
+ if (self::$showImagesUrl == null) {
39
+ self::$showImagesUrl = (int) Mage::getStoreConfig('enhancedgrid/images/showurl') === 1;
40
+ }
41
+ if (self::$showByDefault == null) {
42
+ self::$showByDefault = (int) Mage::getStoreConfig('enhancedgrid/images/showbydefault') === 1;
43
+ }
44
+ if (self::$width == null) {
45
+ self::$width = Mage::getStoreConfig('enhancedgrid/images/width');
46
+ }
47
+ if (self::$height == null) {
48
+ self::$height = Mage::getStoreConfig('enhancedgrid/images/height');
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Renders grid column.
54
+ *
55
+ * @param Varien_Object $row
56
+ *
57
+ * @return string
58
+ */
59
+ public function render(Varien_Object $row)
60
+ {
61
+ return $this->_getValue($row);
62
+ }
63
+
64
+ /*
65
+ public function renderProperty(Varien_Object $row)
66
+ {
67
+ $val = $row->getData($this->getColumn()->getIndex());
68
+ $val = Mage::helper('imagebyurl')->getImageUrl($val);
69
+ $out = parent::renderProperty(). ' onclick="showImage('.$val.')" ';
70
+ return $out;
71
+ }
72
+
73
+ */
74
+ protected function _getValue(Varien_Object $row)
75
+ {
76
+ $dored = false;
77
+ if ($getter = $this->getColumn()->getGetter()) {
78
+ $val = $row->$getter();
79
+ }
80
+ $val = $val2 = $row->getData($this->getColumn()->getIndex());
81
+ $val = str_replace('no_selection', '', $val);
82
+ $val2 = str_replace('no_selection', '', $val2);
83
+ $url = Mage::helper('enhancedgrid')->getImageUrl($val);
84
+
85
+ if (!Mage::helper('enhancedgrid')->getFileExists($val)) {
86
+ $dored = true;
87
+ $val .= '[!]';
88
+ }
89
+ if (strpos($val, 'placeholder/')) {
90
+ $dored = true;
91
+ }
92
+
93
+ $filename = substr($val2, strrpos($val2, '/') + 1, strlen($val2) - strrpos($val2, '/') - 1);
94
+ if (!self::$showImagesUrl) {
95
+ $filename = '';
96
+ }
97
+ if ($dored) {
98
+ $val = "<span style=\"color:red\" id=\"img\">$filename</span>";
99
+ } else {
100
+ $val = '<span>'.$filename.'</span>';
101
+ }
102
+
103
+ if (empty($val2)) {
104
+ $out = '<center>'.$this->__('(no image)').'</center>';
105
+ } else {
106
+ $out = $val.'<center><a href="#" onclick="window.open(\''.$url.'\', \''.$val2.'\')"'.
107
+ 'title="'.$val2.'" '.' url="'.$url.'" id="imageurl">';
108
+ }
109
+
110
+ if (self::$showByDefault && !empty($val2)) {
111
+ $out .= '<img src='.$url." width='".self::$width."' ";
112
+ if (self::$height > self::$width) {
113
+ $out .= "height='".self::$height."' ";
114
+ }
115
+ $out .= ' />';
116
+ }
117
+ //die( $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135));
118
+ $out .= '</a></center>';
119
+
120
+ return $out;
121
+ }
122
+ }
app/code/community/TBT/Enhancedgrid/Block/Widget/Loyalty.php CHANGED
@@ -1,61 +1,65 @@
1
- <?php
2
- /**
3
- * This class passes information about current version of Enhancedgrid being run to the WDCA server.
4
- * All information is confidential and never distributed to any third priorities.
5
- *
6
- * @category TBT
7
- * @package TBT_Enhancedgrid
8
- * @author WDCA Team <contact@wdca.ca>
9
- */
10
- class TBT_Enhancedgrid_Block_Widget_Loyalty extends Mage_Adminhtml_Block_Template {
11
- public function _toHtml() {
12
- $html = <<<FEED
13
- <!-- Visit http://www.wdca.ca/m for information about this frame. You can remove it if you want. -->
14
- <iframe src="{$this->_getLoyaltyUrl()}" marginwidth="0" marginheight="0"
15
- align="middle" frameborder="0"
16
- scrolling="no" style="width: 500px; float: left; height: 22px;">
17
- </iframe>
18
- FEED;
19
-
20
- return $html;
21
- }
22
-
23
- protected function _getLoyaltyUrl() {
24
- $url = $this->_getBaseLoyaltyUrl();
25
-
26
- $url_data = array();
27
- $url_data["a"] = "enhancedgrid";
28
- $url_data["v"] = (string) Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version');
29
- $url_data["m"] = Mage::getVersion();
30
- $url_data["p"] = urlencode($this->getBaseUrl());
31
- $url_data["ap"] = urlencode($this->getAction()->getFullActionName());
32
- //$url_data["license"] = Mage::helper('rewards/loyalty_checker')->getLicenseKey();
33
-
34
- $url_data_json = json_encode($url_data);
35
-
36
- $salt = "welovewdca12345!!";
37
-
38
- $url_data_json_hex = bin2hex($url_data_json . $salt);
39
-
40
- $url = $url . "?data=" . $url_data_json_hex;
41
-
42
- return $url;
43
- }
44
-
45
- protected function _getBaseLoyaltyUrl() {
46
-
47
- $url = "https://www.wdca.ca/m/";
48
-
49
- //@nelkaake: If the page is supposed to be HTTPS and the AJAX call is not HTTPS, add HTTPS
50
- // if it's HTTP and the url returned HTTPS, remove HTTPS
51
- if( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && strpos(strtolower($url), 'https') !== 0) {
52
- $url = str_replace('http', 'https', $url);
53
- } elseif(!isset($_SERVER['HTTPS']) || !$_SERVER['HTTPS'] && strpos(strtolower($url), 'https') === 0) {
54
- $url = str_replace('https', 'http', $url);
55
- } else {
56
- // the url is fine and we can continue because it's using the correct encryption
57
- }
58
-
59
- return $url;
60
- }
61
- }
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This class passes information about current version of Enhancedgrid being run to the Magecredit server.
5
+ * All information is confidential and never distributed to any third priorities.
6
+ *
7
+ * @category Wellfounded
8
+ * @author Magecredit Team <hi@magecredit.com>
9
+ */
10
+ class TBT_Enhancedgrid_Block_Widget_Loyalty extends Mage_Adminhtml_Block_Template
11
+ {
12
+ public function _toHtml()
13
+ {
14
+ $html = <<<FEED
15
+ <!-- You can remove it if you want though it's what helps pay for support of the free and open source module. -->
16
+ <!-- See https://github.com/jayelkaake/enhancedgrid for more info. -->
17
+ <iframe src="{$this->_getLoyaltyUrl()}" marginwidth="0" marginheight="0"
18
+ align="middle" frameborder="0"
19
+ scrolling="no" style="width: 500px; float: left; height: 22px;">
20
+ </iframe>
21
+ FEED;
22
+
23
+ return $html;
24
+ }
25
+
26
+ protected function _getLoyaltyUrl()
27
+ {
28
+ $url = $this->_getBaseLoyaltyUrl();
29
+
30
+ $url_data = array();
31
+ $url_data['a'] = 'enhancedgrid';
32
+ $url_data['v'] = (string) Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version');
33
+ $url_data['m'] = Mage::getVersion();
34
+ $url_data['p'] = urlencode($this->getBaseUrl());
35
+ $url_data['ap'] = urlencode($this->getAction()->getFullActionName());
36
+ //$url_data["license"] = Mage::helper('rewards/loyalty_checker')->getLicenseKey();
37
+
38
+ $url_data_json = json_encode($url_data);
39
+
40
+ $salt = 'welovewdca12345!!';
41
+
42
+ $url_data_json_hex = bin2hex($url_data_json.$salt);
43
+
44
+ $url = $url.'?data='.$url_data_json_hex;
45
+
46
+ return $url;
47
+ }
48
+
49
+ protected function _getBaseLoyaltyUrl()
50
+ {
51
+ $url = 'https://www.magecredit.com/m/';
52
+
53
+ //@nelkaake: If the page is supposed to be HTTPS and the AJAX call is not HTTPS, add HTTPS
54
+ // if it's HTTP and the url returned HTTPS, remove HTTPS
55
+ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && strpos(strtolower($url), 'https') !== 0) {
56
+ $url = str_replace('http', 'https', $url);
57
+ } elseif (!isset($_SERVER['HTTPS']) || !$_SERVER['HTTPS'] && strpos(strtolower($url), 'https') === 0) {
58
+ $url = str_replace('https', 'http', $url);
59
+ } else {
60
+ // the url is fine and we can continue because it's using the correct encryption
61
+ }
62
+
63
+ return $url;
64
+ }
65
+ }
app/code/community/TBT/Enhancedgrid/Helper/Data.php CHANGED
@@ -1,66 +1,66 @@
1
- <?PHP
2
-
3
- class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract {
4
-
5
-
6
- public function getImageUrl($image_file)
7
- {
8
- $url = false;
9
- $url = Mage::getBaseUrl('media').'catalog/product'. $image_file;
10
- return $url;
11
- }
12
-
13
-
14
- public function getFileExists($image_file)
15
- {
16
- $file_exists = false;
17
- $file_exists = file_exists('media/catalog/product'. $image_file);
18
- return $file_exists;
19
- }
20
-
21
-
22
- public function getSearchCollection($queryString, $request) {
23
- //@nelkaake -m 13/11/10: Added compatibility with Magento 1.4 and up
24
- if(Mage::helper('enhancedgrid')->isMageVerAtLeast('1.4.0.0')) {
25
- $res = Mage::helper('catalogsearch')->getQuery()
26
- ->getSearchCollection()
27
- ->setStoreId(Mage::app()->getStore()->getId())
28
- ->addSearchFilter($queryString);
29
- } else {
30
- $request->setParam('q', $queryString);
31
- $searchquery = Mage::helper('catalogSearch')->getQuery();
32
- $searchquery->setStoreId(Mage::app()->getStore()->getId());
33
- $searchquery->save();
34
- $res = $searchquery->getResultCollection();
35
- }
36
-
37
- return $res;
38
- }
39
-
40
-
41
- /**
42
- * True if the Magento version currently being run is x.x.x.x or higher
43
- *
44
- * @usage isMageVersionAtLeast('1.4.0.0') returns true for 1.4.0.0 and >
45
- *
46
- * @return boolean
47
- */
48
- public function isMageVerAtLeast($version_str) {
49
- $version_str_sections = explode('.', $version_str);
50
- $mage_version_sections = explode('.', Mage::getVersion());
51
- foreach( $version_str_sections as $key => $value){
52
- if(!isset($mage_version_sections[$key])) break;
53
-
54
- if ($mage_version_sections[$key] > $value ){
55
- return true;
56
- }
57
- if ($mage_version_sections[$key] < $value ) {
58
- return false;
59
- }
60
- }
61
- return true;
62
- }
63
-
64
-
65
- }
66
- ?>
1
+ <?PHP
2
+
3
+ class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getImageUrl($image_file)
6
+ {
7
+ $url = false;
8
+ $url = Mage::getBaseUrl('media').'catalog/product'.$image_file;
9
+
10
+ return $url;
11
+ }
12
+
13
+ public function getFileExists($image_file)
14
+ {
15
+ $file_exists = false;
16
+ $file_exists = file_exists('media/catalog/product'.$image_file);
17
+
18
+ return $file_exists;
19
+ }
20
+
21
+ public function getSearchCollection($queryString, $request)
22
+ {
23
+ //@nelkaake -m 13/11/10: Added compatibility with Magento 1.4 and up
24
+ if (Mage::helper('enhancedgrid')->isMageVerAtLeast('1.4.0.0')) {
25
+ $res = Mage::helper('catalogsearch')->getQuery()
26
+ ->getSearchCollection()
27
+ ->setStoreId(Mage::app()->getStore()->getId())
28
+ ->addSearchFilter($queryString);
29
+ } else {
30
+ $request->setParam('q', $queryString);
31
+ $searchquery = Mage::helper('catalogSearch')->getQuery();
32
+ $searchquery->setStoreId(Mage::app()->getStore()->getId());
33
+ $searchquery->save();
34
+ $res = $searchquery->getResultCollection();
35
+ }
36
+
37
+ return $res;
38
+ }
39
+
40
+ /**
41
+ * True if the Magento version currently being run is x.x.x.x or higher.
42
+ *
43
+ * @usage isMageVersionAtLeast('1.4.0.0') returns true for 1.4.0.0 and >
44
+ *
45
+ * @return bool
46
+ */
47
+ public function isMageVerAtLeast($version_str)
48
+ {
49
+ $version_str_sections = explode('.', $version_str);
50
+ $mage_version_sections = explode('.', Mage::getVersion());
51
+ foreach ($version_str_sections as $key => $value) {
52
+ if (!isset($mage_version_sections[$key])) {
53
+ break;
54
+ }
55
+
56
+ if ($mage_version_sections[$key] > $value) {
57
+ return true;
58
+ }
59
+ if ($mage_version_sections[$key] < $value) {
60
+ return false;
61
+ }
62
+ }
63
+
64
+ return true;
65
+ }
66
+ }
app/code/community/TBT/Enhancedgrid/Helper/Version.php CHANGED
@@ -1,219 +1,257 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 WDCA (http://www.wdca.ca)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- /**
27
- * Version Helper Data
28
- *
29
- * @category TBT
30
- * @package TBT_Enhancedgrid
31
- * @author WDCA Team <contact@wdca.ca>
32
- */
33
- class TBT_Enhancedgrid_Helper_Version extends Mage_Core_Helper_Abstract {
34
-
35
- /**
36
- * Returns true if the base version of this Magento installation
37
- * is equal to the version specified or newer.
38
- * @param string $version
39
- * @param unknown_type $task
40
- */
41
- public function isBaseMageVersionAtLeast($version, $task = null) {
42
- // convert Magento Enterprise, Professional, Community to a base version
43
- $mage_base_version = $this->convertVersionToCommunityVersion ( Mage::getVersion (), $task );
44
-
45
- if (version_compare ( $mage_base_version, $version, '>=' )) {
46
- return true;
47
- }
48
- return false;
49
- }
50
-
51
- /**
52
- * True if the base version is at least the verison specified without converting version numbers to other versions of Magento.
53
- *
54
- * @param string $version
55
- * @param unknown_type $task
56
- * @return boolean
57
- */
58
- public function isRawVerAtLeast($version) {
59
- // convert Magento Enterprise, Professional, Community to a base version
60
- $mage_base_version = Mage::getVersion ();
61
-
62
- if (version_compare ( $mage_base_version, $version, '>=' )) {
63
- return true;
64
- }
65
- return false;
66
- }
67
-
68
- /**
69
- * True if the base version is at least the verison specified without checking
70
- * @param string $version
71
- */
72
- public function isEnterpriseAtLeast($version) {
73
- if(!$this->isMageEnterprise()) return false;
74
-
75
- return $this->isRawVerAtLeast($version);
76
- }
77
-
78
- /**
79
- *
80
- * @param string $version
81
- * @param unknown_type $task
82
- * @return boolean
83
- */
84
- public function isBaseMageVersion($version, $task = null) {
85
- // convert Magento Enterprise, Professional, Community to a base version
86
- $mage_base_version = $this->convertVersionToCommunityVersion ( Mage::getVersion (), $task );
87
-
88
- if (version_compare ( $mage_base_version, $version, '=' )) {
89
- return true;
90
- }
91
- return false;
92
- }
93
-
94
- /** * @alias isBaseMageVersion */
95
- public function isMageVersion($version, $task = null) {
96
- return $this->isBaseMageVersion ( $version, $task );
97
- }
98
-
99
- /** * @alias isBaseMageVersion */
100
- public function isMage($version, $task = null) {
101
- return $this->isBaseMageVersion ( $version, $task );
102
- }
103
-
104
- /** * @alias isBaseMageVersionAtLeast */
105
- public function isMageVersionAtLeast($version, $task = null) {
106
- return $this->isBaseMageVersionAtLeast ( $version, $task );
107
- }
108
-
109
- /**
110
- * True if the Magento version currently running is between the versions specified inclusive
111
- * @nelkaake -a 16/11/10:
112
- * @param string $version
113
- * @param unknown_type $task
114
- * @return boolean
115
- */
116
- public function isMageVersionBetween($version1, $version2, $task = null) {
117
-
118
- $is_between = $this->isBaseMageVersionAtLeast ( $version1, $task ) && ! $this->isBaseMageVersionAtLeast ( $version2, $task );
119
- $is_later_version = $this->isMageVersion ( $version2 );
120
- return $is_between || $is_later_version;
121
- }
122
-
123
- /**
124
- * True if the version of Magento currently being rune is Enterprise Edition
125
- */
126
- public function isMageEnterprise() {
127
- return Mage::getConfig ()->getModuleConfig ( 'Enterprise_Enterprise' ) && Mage::getConfig ()->getModuleConfig ( 'Enterprise_AdminGws' ) && Mage::getConfig ()->getModuleConfig ( 'Enterprise_Checkout' ) && Mage::getConfig ()->getModuleConfig ( 'Enterprise_Customer' );
128
- }
129
-
130
- /**
131
- * attempt to convert an Enterprise, Professional, Community magento version number to its compatable Community version
132
- *
133
- * @param string $task fix problems where direct version numbers cant be changed to a community release without knowing the intent of the task
134
- */
135
- public function convertVersionToCommunityVersion($version, $task = null) {
136
-
137
- /* Enterprise -
138
- * 1.9 | 1.8 | 1.5
139
- */
140
- if ($this->isMageEnterprise()) {
141
- if (version_compare ( $version, '1.11.0', '>=' ))
142
- return '1.6.0';
143
- if (version_compare ( $version, '1.9.1', '>=' ))
144
- return '1.5.0';
145
- if (version_compare ( $version, '1.9.0', '>=' ))
146
- return '1.4.2';
147
- if (version_compare ( $version, '1.8.0', '>=' ))
148
- return '1.3.1';
149
- return '1.3.1';
150
- }
151
-
152
- /* Professional -
153
- * If Entprise_Enterprise module is installed but it didn't pass Enterprise_Enterprise tests
154
- * then the installation must be Magento Pro edition.
155
- * 1.7 | 1.8
156
- */
157
- if (Mage::getConfig ()->getModuleConfig ( 'Enterprise_Enterprise' )) {
158
- if (version_compare ( $version, '1.8.0', '>=' ))
159
- return '1.4.1';
160
- if (version_compare ( $version, '1.7.0', '>=' ))
161
- return '1.3.1';
162
- return '1.3.1';
163
- }
164
-
165
- /* Community -
166
- * 1.5rc2 - December 29, 2010
167
- * 1.4.2 - December 8, 2010
168
- * 1.4.1 - June 10, 2010
169
- * 1.3.3.0 - (April 23, 2010) *** does this release work like to 1.4.0.1?
170
- * 1.4.0.1 - (February 19, 2010)
171
- * 1.4.0.0 - (February 12, 2010)
172
- * 1.3.0 - March 30, 2009
173
- * 1.2.1.1 - February 23, 2009
174
- * 1.1 - July 24, 2008
175
- * 0.6.1316 - October 18, 2007
176
- */
177
- return $version;
178
- }
179
-
180
- /**
181
- * start E_DEPRECATED =================================================================================
182
- */
183
- /**
184
- * @deprecated use isBaseMageVersion isntead
185
- * @return boolean
186
- */
187
- public function isMageVersion12() {
188
- return $this->isMageVersion ( '1.2' );
189
- }
190
-
191
- /**
192
- * @deprecated use isBaseMageVersion isntead
193
- * @return boolean
194
- */
195
- public function isMageVersion131() {
196
- return $this->isMageVersion ( '1.3.1' );
197
- }
198
-
199
- /**
200
- * @deprecated use isBaseMageVersion instead
201
- * @return boolean
202
- */
203
- public function isMageVersion14() {
204
- return $this->isMageVersion ( '1.4' );
205
- }
206
-
207
- /**
208
- * @deprecated use isMageVersionAtLeast isntead
209
- * @return boolean
210
- */
211
- public function isMageVersionAtLeast14() {
212
- //@nelkaake Changed on Sunday August 15, 2010:
213
- return $this->isBaseMageVersionAtLeast ( '1.4.0.0' );
214
- }
215
-
216
- /**
217
- * end E_DEPRECATED =================================================================================
218
- */
219
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ /**
28
+ * Version Helper Data.
29
+ *
30
+ * @category TBT
31
+ *
32
+ * @author Sweet Tooth Team <contact@sweettoothrewards.com>
33
+ */
34
+ class TBT_Enhancedgrid_Helper_Version extends Mage_Core_Helper_Abstract
35
+ {
36
+ /**
37
+ * Returns true if the base version of this Magento installation
38
+ * is equal to the version specified or newer.
39
+ *
40
+ * @param string $version
41
+ * @param unknown_type $task
42
+ */
43
+ public function isBaseMageVersionAtLeast($version, $task = null)
44
+ {
45
+ // convert Magento Enterprise, Professional, Community to a base version
46
+ $mage_base_version = $this->convertVersionToCommunityVersion(Mage::getVersion(), $task);
47
+
48
+ if (version_compare($mage_base_version, $version, '>=')) {
49
+ return true;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * True if the base version is at least the verison specified without converting version numbers to other versions of Magento.
57
+ *
58
+ * @param string $version
59
+ * @param unknown_type $task
60
+ *
61
+ * @return bool
62
+ */
63
+ public function isRawVerAtLeast($version)
64
+ {
65
+ // convert Magento Enterprise, Professional, Community to a base version
66
+ $mage_base_version = Mage::getVersion();
67
+
68
+ if (version_compare($mage_base_version, $version, '>=')) {
69
+ return true;
70
+ }
71
+
72
+ return false;
73
+ }
74
+
75
+ /**
76
+ * True if the base version is at least the verison specified without checking.
77
+ *
78
+ * @param string $version
79
+ */
80
+ public function isEnterpriseAtLeast($version)
81
+ {
82
+ if (!$this->isMageEnterprise()) {
83
+ return false;
84
+ }
85
+
86
+ return $this->isRawVerAtLeast($version);
87
+ }
88
+
89
+ /**
90
+ * @param string $version
91
+ * @param unknown_type $task
92
+ *
93
+ * @return bool
94
+ */
95
+ public function isBaseMageVersion($version, $task = null)
96
+ {
97
+ // convert Magento Enterprise, Professional, Community to a base version
98
+ $mage_base_version = $this->convertVersionToCommunityVersion(Mage::getVersion(), $task);
99
+
100
+ if (version_compare($mage_base_version, $version, '=')) {
101
+ return true;
102
+ }
103
+
104
+ return false;
105
+ }
106
+
107
+ /** * @alias isBaseMageVersion */
108
+ public function isMageVersion($version, $task = null)
109
+ {
110
+ return $this->isBaseMageVersion($version, $task);
111
+ }
112
+
113
+ /** * @alias isBaseMageVersion */
114
+ public function isMage($version, $task = null)
115
+ {
116
+ return $this->isBaseMageVersion($version, $task);
117
+ }
118
+
119
+ /** * @alias isBaseMageVersionAtLeast */
120
+ public function isMageVersionAtLeast($version, $task = null)
121
+ {
122
+ return $this->isBaseMageVersionAtLeast($version, $task);
123
+ }
124
+
125
+ /**
126
+ * True if the Magento version currently running is between the versions specified inclusive.
127
+ *
128
+ * @nelkaake -a 16/11/10:
129
+ *
130
+ * @param string $version
131
+ * @param unknown_type $task
132
+ *
133
+ * @return bool
134
+ */
135
+ public function isMageVersionBetween($version1, $version2, $task = null)
136
+ {
137
+ $is_between = $this->isBaseMageVersionAtLeast($version1, $task) && !$this->isBaseMageVersionAtLeast($version2, $task);
138
+ $is_later_version = $this->isMageVersion($version2);
139
+
140
+ return $is_between || $is_later_version;
141
+ }
142
+
143
+ /**
144
+ * True if the version of Magento currently being rune is Enterprise Edition.
145
+ */
146
+ public function isMageEnterprise()
147
+ {
148
+ return Mage::getConfig()->getModuleConfig('Enterprise_Enterprise') && Mage::getConfig()->getModuleConfig('Enterprise_AdminGws') && Mage::getConfig()->getModuleConfig('Enterprise_Checkout') && Mage::getConfig()->getModuleConfig('Enterprise_Customer');
149
+ }
150
+
151
+ /**
152
+ * attempt to convert an Enterprise, Professional, Community magento version number to its compatable Community version.
153
+ *
154
+ * @param string $task fix problems where direct version numbers cant be changed to a community release without knowing the intent of the task
155
+ */
156
+ public function convertVersionToCommunityVersion($version, $task = null)
157
+ {
158
+
159
+ /* Enterprise -
160
+ * 1.9 | 1.8 | 1.5
161
+ */
162
+ if ($this->isMageEnterprise()) {
163
+ if (version_compare($version, '1.11.0', '>=')) {
164
+ return '1.6.0';
165
+ }
166
+ if (version_compare($version, '1.9.1', '>=')) {
167
+ return '1.5.0';
168
+ }
169
+ if (version_compare($version, '1.9.0', '>=')) {
170
+ return '1.4.2';
171
+ }
172
+ if (version_compare($version, '1.8.0', '>=')) {
173
+ return '1.3.1';
174
+ }
175
+
176
+ return '1.3.1';
177
+ }
178
+
179
+ /* Professional -
180
+ * If Entprise_Enterprise module is installed but it didn't pass Enterprise_Enterprise tests
181
+ * then the installation must be Magento Pro edition.
182
+ * 1.7 | 1.8
183
+ */
184
+ if (Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')) {
185
+ if (version_compare($version, '1.8.0', '>=')) {
186
+ return '1.4.1';
187
+ }
188
+ if (version_compare($version, '1.7.0', '>=')) {
189
+ return '1.3.1';
190
+ }
191
+
192
+ return '1.3.1';
193
+ }
194
+
195
+ /* Community -
196
+ * 1.5rc2 - December 29, 2010
197
+ * 1.4.2 - December 8, 2010
198
+ * 1.4.1 - June 10, 2010
199
+ * 1.3.3.0 - (April 23, 2010) *** does this release work like to 1.4.0.1?
200
+ * 1.4.0.1 - (February 19, 2010)
201
+ * 1.4.0.0 - (February 12, 2010)
202
+ * 1.3.0 - March 30, 2009
203
+ * 1.2.1.1 - February 23, 2009
204
+ * 1.1 - July 24, 2008
205
+ * 0.6.1316 - October 18, 2007
206
+ */
207
+ return $version;
208
+ }
209
+
210
+ /**
211
+ * start E_DEPRECATED =================================================================================.
212
+ */
213
+ /**
214
+ * @deprecated use isBaseMageVersion isntead
215
+ *
216
+ * @return bool
217
+ */
218
+ public function isMageVersion12()
219
+ {
220
+ return $this->isMageVersion('1.2');
221
+ }
222
+
223
+ /**
224
+ * @deprecated use isBaseMageVersion isntead
225
+ *
226
+ * @return bool
227
+ */
228
+ public function isMageVersion131()
229
+ {
230
+ return $this->isMageVersion('1.3.1');
231
+ }
232
+
233
+ /**
234
+ * @deprecated use isBaseMageVersion instead
235
+ *
236
+ * @return bool
237
+ */
238
+ public function isMageVersion14()
239
+ {
240
+ return $this->isMageVersion('1.4');
241
+ }
242
+
243
+ /**
244
+ * @deprecated use isMageVersionAtLeast isntead
245
+ *
246
+ * @return bool
247
+ */
248
+ public function isMageVersionAtLeast14()
249
+ {
250
+ //@nelkaake Changed on Sunday August 15, 2010:
251
+ return $this->isBaseMageVersionAtLeast('1.4.0.0');
252
+ }
253
+
254
+ /*
255
+ * end E_DEPRECATED =================================================================================
256
+ */
257
+ }
app/code/community/TBT/Enhancedgrid/Model/Collection/Decorator/Abstract.php CHANGED
@@ -1,37 +1,41 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 WDCA (http://www.wdca.ca)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- abstract class TBT_Enhancedgrid_Model_Collection_Decorator_Abstract extends Varien_Object{
27
- protected $_collection = null;
28
- public function setCollection(TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection $collection) {
29
- $this->_collection = $collection;
30
-
31
- return $this;
32
- }
33
-
34
- public function getCollection() {
35
- return $this->_collection;
36
- }
37
- }
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ abstract class TBT_Enhancedgrid_Model_Collection_Decorator_Abstract extends Varien_Object
28
+ {
29
+ protected $_collection = null;
30
+ public function setCollection(TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection $collection)
31
+ {
32
+ $this->_collection = $collection;
33
+
34
+ return $this;
35
+ }
36
+
37
+ public function getCollection()
38
+ {
39
+ return $this->_collection;
40
+ }
41
+ }
app/code/community/TBT/Enhancedgrid/Model/Product/Collection/Category/Decorator.php CHANGED
@@ -1,71 +1,69 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 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_Model_Product_Collection_Category_Decorator extends TBT_Enhancedgrid_Model_Collection_Decorator_Abstract {
27
-
28
-
29
- public function setCollection(TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection $collection) {
30
- return parent::setCollection( $collection );
31
- }
32
-
33
- /**
34
- * Adds category data for the products collection using the currently stored collection model.
35
- */
36
- public function addCategories() {
37
-
38
- $collection = $this->getCollection();
39
-
40
- $alias_prefix = $this->_getAliasPrefix();
41
-
42
- $collection->joinField( 'category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left' );
43
-
44
- $category_name_attribute_id = Mage::getModel( 'eav/entity_attribute' )->loadByCode( 'catalog_category', 'name' )->getId();
45
-
46
- //@nelkaake -m 13/11/10: Added support for tables with prefixes
47
- $ccev_t = Mage::getConfig()->getTablePrefix() . 'catalog_category_entity_varchar';
48
-
49
- $collection->joinField( 'categories', $ccev_t, "GROUP_CONCAT({$alias_prefix}categories.value)", 'entity_id=category_id',
50
- "{$alias_prefix}categories.attribute_id={$category_name_attribute_id}", 'left' );
51
-
52
- $collection->joinField( 'category', $ccev_t, 'value', 'entity_id=category_id',
53
- "{$alias_prefix}category.attribute_id={$category_name_attribute_id}", 'left' );
54
-
55
- $collection->groupByAttribute( 'entity_id' );
56
-
57
- return $this;
58
-
59
- }
60
-
61
-
62
-
63
- protected function _getAliasPrefix() {
64
- if(Mage::helper('enhancedgrid/version')->isBaseMageVersionAtLeast('1.6')) {
65
- return 'at_';
66
- }
67
-
68
- return '_table_';
69
- }
70
-
71
- }
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class TBT_Enhancedgrid_Model_Product_Collection_Category_Decorator extends TBT_Enhancedgrid_Model_Collection_Decorator_Abstract
28
+ {
29
+ public function setCollection(TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection $collection)
30
+ {
31
+ return parent::setCollection($collection);
32
+ }
33
+
34
+ /**
35
+ * Adds category data for the products collection using the currently stored collection model.
36
+ */
37
+ public function addCategories()
38
+ {
39
+ $collection = $this->getCollection();
40
+
41
+ $alias_prefix = $this->_getAliasPrefix();
42
+
43
+ $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left');
44
+
45
+ $category_name_attribute_id = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_category', 'name')->getId();
46
+
47
+ //@nelkaake -m 13/11/10: Added support for tables with prefixes
48
+ $ccev_t = Mage::getConfig()->getTablePrefix().'catalog_category_entity_varchar';
49
+
50
+ $collection->joinField('categories', $ccev_t, "GROUP_CONCAT({$alias_prefix}categories.value)", 'entity_id=category_id',
51
+ "{$alias_prefix}categories.attribute_id={$category_name_attribute_id}", 'left');
52
+
53
+ $collection->joinField('category', $ccev_t, 'value', 'entity_id=category_id',
54
+ "{$alias_prefix}category.attribute_id={$category_name_attribute_id}", 'left');
55
+
56
+ $collection->groupByAttribute('entity_id');
57
+
58
+ return $this;
59
+ }
60
+
61
+ protected function _getAliasPrefix()
62
+ {
63
+ if (Mage::helper('enhancedgrid/version')->isBaseMageVersionAtLeast('1.6')) {
64
+ return 'at_';
65
+ }
66
+
67
+ return '_table_';
68
+ }
69
+ }
 
 
app/code/community/TBT/Enhancedgrid/Model/Product/Grid/Settings/Columns.php CHANGED
@@ -1,184 +1,189 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 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_Model_Product_Grid_Settings_Columns extends Varien_Object {
27
-
28
- protected $columnSettings = array();
29
-
30
- public function getStore() {
31
- if($this->getData('store')) return $this->getData('store');
32
-
33
- return Mage::app()->getStore();
34
- }
35
-
36
- public function getColumnSettingsArray() {
37
- $this->columnSettings = array();
38
- $storeSettings = Mage::getStoreConfig( 'enhancedgrid/columns/showcolumns' );
39
-
40
- $tempArr = explode( ',', $storeSettings );
41
-
42
- foreach ($tempArr as $showCol) {
43
- $this->columnSettings[trim( $showCol )] = true;
44
- }
45
-
46
- return $this->columnSettings;
47
- }
48
-
49
-
50
- public function getDefaults() {
51
- $truncate = Mage::getStoreConfig( 'enhancedgrid/general/truncatelongtextafter' );
52
- $currency = $this->getStore()->getBaseCurrency()->getCode();
53
- $defaults = array(
54
- 'cost' => array(
55
- 'type' => 'price',
56
- 'width' => '30px',
57
- 'header' => Mage::helper( 'catalog' )->__( 'Cost' ),
58
- 'currency_code' => $currency
59
- ),
60
- 'weight' => array(
61
- 'type' => 'number',
62
- 'width' => '30px',
63
- 'header' => Mage::helper( 'catalog' )->__( 'Weight' )
64
- ),
65
- 'bss_weight' => array(
66
- 'type' => 'number',
67
- 'width' => '30px',
68
- 'header' => Mage::helper( 'catalog' )->__( 'BSS Weight' )
69
- ),
70
- 'url_key' => array(
71
- 'type' => 'text',
72
- 'width' => '100px',
73
- 'header' => Mage::helper( 'catalog' )->__( 'Url Key' )
74
- ),
75
- 'tier_price' => array(
76
- 'type' => 'price',
77
- 'width' => '100px',
78
- 'header' => Mage::helper( 'catalog' )->__( 'Tier Price' ),
79
- 'currency_code' => $currency
80
- ),
81
- 'tax_class_id' => array(
82
- 'type' => 'text',
83
- 'width' => '100px',
84
- 'header' => Mage::helper( 'catalog' )->__( 'Tax Class ID' )
85
- ),
86
- 'special_to_date' => array(
87
- 'type' => 'date',
88
- 'width' => '100px',
89
- 'header' => Mage::helper( 'catalog' )->__( 'Spshl TO Date' )
90
- ),
91
- //@nelkaake Tuesday April 27, 2010 :
92
- 'created_at' => array(
93
- 'type' => 'datetime',
94
- 'width' => '100px',
95
- 'header' => Mage::helper( 'catalog' )->__( 'Date Created' )
96
- ),
97
- 'special_price' => array(
98
- 'type' => 'price',
99
- 'width' => '30px',
100
- 'header' => Mage::helper( 'catalog' )->__( 'Special Price' ),
101
- 'currency_code' => $currency
102
- ),
103
- 'special_from_date' => array(
104
- 'type' => 'date',
105
- 'width' => '100px',
106
- 'header' => Mage::helper( 'catalog' )->__( 'Spshl FROM Date' )
107
- ),
108
- 'color' => array(
109
- 'type' => 'text',
110
- 'width' => '70px',
111
- 'header' => Mage::helper( 'catalog' )->__( 'Color' )
112
- ),
113
- 'size' => array(
114
- 'type' => 'text',
115
- 'width' => '70px',
116
- 'header' => Mage::helper( 'catalog' )->__( 'Size' )
117
- ),
118
- 'brand' => array(
119
- 'type' => 'text',
120
- 'width' => '70px',
121
- 'header' => Mage::helper( 'catalog' )->__( 'Brand' )
122
- ),
123
- 'custom_design' => array(
124
- 'type' => 'text',
125
- 'width' => '70px',
126
- 'header' => Mage::helper( 'catalog' )->__( 'Custom Design' )
127
- ),
128
- 'custom_design_from' => array(
129
- 'type' => 'date',
130
- 'width' => '70px',
131
- 'header' => Mage::helper( 'catalog' )->__( 'Custom Design FRM' )
132
- ),
133
- 'custom_design_to' => array(
134
- 'type' => 'date',
135
- 'width' => '70px',
136
- 'header' => Mage::helper( 'catalog' )->__( 'Custom Design TO' )
137
- ),
138
- 'default_category_id' => array(
139
- 'type' => 'text',
140
- 'width' => '70px',
141
- 'header' => Mage::helper( 'catalog' )->__( 'Default Categry ID' )
142
- ),
143
- 'dimension' => array(
144
- 'type' => 'text',
145
- 'width' => '75px',
146
- 'header' => Mage::helper( 'catalog' )->__( 'Dimensions' )
147
- ),
148
- 'manufacturer' => array(
149
- 'type' => 'text',
150
- 'width' => '75px',
151
- 'header' => Mage::helper( 'catalog' )->__( 'Manufacturer' )
152
- ),
153
- 'meta_keyword' => array(
154
- 'type' => 'text',
155
- 'width' => '200px',
156
- 'header' => Mage::helper( 'catalog' )->__( 'Meta Keywds' )
157
- ),
158
- 'meta_description' => array(
159
- 'type' => 'text',
160
- 'width' => '200px',
161
- 'header' => Mage::helper( 'catalog' )->__( 'Meta Descr' )
162
- ),
163
- 'meta_title' => array(
164
- 'type' => 'text',
165
- 'width' => '100px',
166
- 'header' => Mage::helper( 'catalog' )->__( 'Meta Title' )
167
- ),
168
- 'short_description' => array(
169
- 'type' => 'text',
170
- 'width' => '150px',
171
- 'header' => Mage::helper( 'catalog' )->__( 'Short Description' ),
172
- 'string_limit' => $truncate
173
- ),
174
- 'description' => array(
175
- 'type' => 'text',
176
- 'width' => '200px',
177
- 'header' => Mage::helper( 'catalog' )->__( 'Description' ),
178
- 'string_limit' => $truncate
179
- )
180
- );
181
-
182
- return $defaults;
183
- }
184
- }
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class TBT_Enhancedgrid_Model_Product_Grid_Settings_Columns extends Varien_Object
28
+ {
29
+ protected $columnSettings = array();
30
+
31
+ public function getStore()
32
+ {
33
+ if ($this->getData('store')) {
34
+ return $this->getData('store');
35
+ }
36
+
37
+ return Mage::app()->getStore();
38
+ }
39
+
40
+ public function getColumnSettingsArray()
41
+ {
42
+ $this->columnSettings = array();
43
+ $storeSettings = Mage::getStoreConfig('enhancedgrid/columns/showcolumns');
44
+
45
+ $tempArr = explode(',', $storeSettings);
46
+
47
+ foreach ($tempArr as $showCol) {
48
+ $this->columnSettings[trim($showCol)] = true;
49
+ }
50
+
51
+ return $this->columnSettings;
52
+ }
53
+
54
+ public function getDefaults()
55
+ {
56
+ $truncate = Mage::getStoreConfig('enhancedgrid/general/truncatelongtextafter');
57
+ $currency = $this->getStore()->getBaseCurrency()->getCode();
58
+ $defaults = array(
59
+ 'cost' => array(
60
+ 'type' => 'price',
61
+ 'width' => '30px',
62
+ 'header' => Mage::helper('catalog')->__('Cost'),
63
+ 'currency_code' => $currency,
64
+ ),
65
+ 'weight' => array(
66
+ 'type' => 'number',
67
+ 'width' => '30px',
68
+ 'header' => Mage::helper('catalog')->__('Weight'),
69
+ ),
70
+ 'bss_weight' => array(
71
+ 'type' => 'number',
72
+ 'width' => '30px',
73
+ 'header' => Mage::helper('catalog')->__('BSS Weight'),
74
+ ),
75
+ 'url_key' => array(
76
+ 'type' => 'text',
77
+ 'width' => '100px',
78
+ 'header' => Mage::helper('catalog')->__('Url Key'),
79
+ ),
80
+ 'tier_price' => array(
81
+ 'type' => 'price',
82
+ 'width' => '100px',
83
+ 'header' => Mage::helper('catalog')->__('Tier Price'),
84
+ 'currency_code' => $currency,
85
+ ),
86
+ 'tax_class_id' => array(
87
+ 'type' => 'text',
88
+ 'width' => '100px',
89
+ 'header' => Mage::helper('catalog')->__('Tax Class ID'),
90
+ ),
91
+ 'special_to_date' => array(
92
+ 'type' => 'date',
93
+ 'width' => '100px',
94
+ 'header' => Mage::helper('catalog')->__('Spshl TO Date'),
95
+ ),
96
+ //@nelkaake Tuesday April 27, 2010 :
97
+ 'created_at' => array(
98
+ 'type' => 'datetime',
99
+ 'width' => '100px',
100
+ 'header' => Mage::helper('catalog')->__('Date Created'),
101
+ ),
102
+ 'special_price' => array(
103
+ 'type' => 'price',
104
+ 'width' => '30px',
105
+ 'header' => Mage::helper('catalog')->__('Special Price'),
106
+ 'currency_code' => $currency,
107
+ ),
108
+ 'special_from_date' => array(
109
+ 'type' => 'date',
110
+ 'width' => '100px',
111
+ 'header' => Mage::helper('catalog')->__('Spshl FROM Date'),
112
+ ),
113
+ 'color' => array(
114
+ 'type' => 'text',
115
+ 'width' => '70px',
116
+ 'header' => Mage::helper('catalog')->__('Color'),
117
+ ),
118
+ 'size' => array(
119
+ 'type' => 'text',
120
+ 'width' => '70px',
121
+ 'header' => Mage::helper('catalog')->__('Size'),
122
+ ),
123
+ 'brand' => array(
124
+ 'type' => 'text',
125
+ 'width' => '70px',
126
+ 'header' => Mage::helper('catalog')->__('Brand'),
127
+ ),
128
+ 'custom_design' => array(
129
+ 'type' => 'text',
130
+ 'width' => '70px',
131
+ 'header' => Mage::helper('catalog')->__('Custom Design'),
132
+ ),
133
+ 'custom_design_from' => array(
134
+ 'type' => 'date',
135
+ 'width' => '70px',
136
+ 'header' => Mage::helper('catalog')->__('Custom Design FRM'),
137
+ ),
138
+ 'custom_design_to' => array(
139
+ 'type' => 'date',
140
+ 'width' => '70px',
141
+ 'header' => Mage::helper('catalog')->__('Custom Design TO'),
142
+ ),
143
+ 'default_category_id' => array(
144
+ 'type' => 'text',
145
+ 'width' => '70px',
146
+ 'header' => Mage::helper('catalog')->__('Default Categry ID'),
147
+ ),
148
+ 'dimension' => array(
149
+ 'type' => 'text',
150
+ 'width' => '75px',
151
+ 'header' => Mage::helper('catalog')->__('Dimensions'),
152
+ ),
153
+ 'manufacturer' => array(
154
+ 'type' => 'text',
155
+ 'width' => '75px',
156
+ 'header' => Mage::helper('catalog')->__('Manufacturer'),
157
+ ),
158
+ 'meta_keyword' => array(
159
+ 'type' => 'text',
160
+ 'width' => '200px',
161
+ 'header' => Mage::helper('catalog')->__('Meta Keywds'),
162
+ ),
163
+ 'meta_description' => array(
164
+ 'type' => 'text',
165
+ 'width' => '200px',
166
+ 'header' => Mage::helper('catalog')->__('Meta Descr'),
167
+ ),
168
+ 'meta_title' => array(
169
+ 'type' => 'text',
170
+ 'width' => '100px',
171
+ 'header' => Mage::helper('catalog')->__('Meta Title'),
172
+ ),
173
+ 'short_description' => array(
174
+ 'type' => 'text',
175
+ 'width' => '150px',
176
+ 'header' => Mage::helper('catalog')->__('Short Description'),
177
+ 'string_limit' => $truncate,
178
+ ),
179
+ 'description' => array(
180
+ 'type' => 'text',
181
+ 'width' => '200px',
182
+ 'header' => Mage::helper('catalog')->__('Description'),
183
+ 'string_limit' => $truncate,
184
+ ),
185
+ );
186
+
187
+ return $defaults;
188
+ }
189
+ }
app/code/community/TBT/Enhancedgrid/Model/Resource/Eav/Mysql4/Product/Collection.php CHANGED
@@ -1,52 +1,53 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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-2011 WDCA (http://www.wdca.ca)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- /**
27
- * Enhanced grid Product collection
28
- * @nelkaake -a 15/12/10:
29
- *
30
- * @category TBT
31
- * @package Enhancedgrid
32
- * @author WDCA
33
- */
34
- class TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection
35
- extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
36
- {
37
-
38
- /**
39
- * Get SQL for get record count
40
- *
41
- * @return Varien_Db_Select
42
- */
43
- public function getSelectCountSql()
44
- {
45
- $countSelect = parent::getSelectCountSql();
46
-
47
- //@nelkaake -a 15/12/10: Reset the group selection. ( for categories grouping)
48
- $countSelect->reset(Zend_Db_Select::GROUP);
49
-
50
- return $countSelect;
51
- }
52
- }
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Sweet Tooth
23
+ *
24
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ /**
28
+ * Enhanced grid Product collection.
29
+ *
30
+ * @nelkaake -a 15/12/10:
31
+ *
32
+ * @category TBT
33
+ *
34
+ * @author Sweet Tooth
35
+ */
36
+ class TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection
37
+ extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
38
+ {
39
+ /**
40
+ * Get SQL for get record count.
41
+ *
42
+ * @return Varien_Db_Select
43
+ */
44
+ public function getSelectCountSql()
45
+ {
46
+ $countSelect = parent::getSelectCountSql();
47
+
48
+ //@nelkaake -a 15/12/10: Reset the group selection. ( for categories grouping)
49
+ $countSelect->reset(Zend_Db_Select::GROUP);
50
+
51
+ return $countSelect;
52
+ }
53
+ }
app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Columns/Show.php CHANGED
@@ -1,67 +1,68 @@
1
- <?php
2
- /**
3
- * WDCA
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
-
21
- /**
22
- * Grid checkbox column renderer
23
- *
24
- * @category WDCA
25
- * @package TBT_Enhancedgrid
26
- * @author WDCA <contact@wdca.ca>
27
- */
28
- class TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show
29
- {
30
- public function toOptionArray()
31
- {
32
- $collection = $this->_getAttrCol();
33
-
34
- $cols = array();
35
- $cols[] = array('value' => 'id', 'label' => 'ID');
36
- $cols[] = array('value' => 'type_id', 'label' => 'Type (simple, bundle, etc)');
37
- $cols[] = array('value' => 'attribute_set_id', 'label' => 'Attribute Set');
38
- $cols[] = array('value' => 'qty', 'label' => 'Quantity');
39
- $cols[] = array('value' => 'websites', 'label' => 'Websites');
40
- $cols[] = array('value' => 'categories', 'label' => 'Categories');
41
- //@nelkaake Tuesday April 27, 2010 :
42
- $cols[] = array('value' => 'created_at', 'label' => 'Date Created');
43
- foreach($collection->getItems() as $col) {
44
- $cols[] = array('value' => $col->getAttributeCode(), 'label' => $col->getFrontendLabel());
45
- }
46
- return $cols;
47
- }
48
-
49
- /**
50
- * @return Mage_Eav_Model_Mysql4_Entity_Attribute_Collection
51
- */
52
- protected function _getAttrCol() {
53
-
54
- if ( Mage::helper( 'enhancedgrid/version' )->isBaseMageVersionAtLeast( '1.4' ) ) {
55
- $collection = Mage::getResourceModel( 'catalog/product_attribute_collection' );
56
-
57
- } else {
58
- $type_id = Mage::getModel( 'eav/entity' )->setType( 'catalog_product' )->getTypeId();
59
- $collection = Mage::getResourceModel( 'eav/entity_attribute_collection' );
60
- $collection->setEntityTypeFilter( $type_id );
61
- }
62
-
63
- $collection->addFilter( "is_visible", 1 );
64
-
65
- return $collection;
66
- }
67
- }
 
1
+ <?php
2
+
3
+ /**
4
+ * Sweet Tooth.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Sweet Tooth
17
+ *
18
+ * @copyright Copyright (c) 2008-2010 Sweet Tooth (http://www.sweettoothrewards.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * Grid checkbox column renderer.
24
+ *
25
+ * @category Sweet Tooth
26
+ *
27
+ * @author Sweet Tooth <contact@sweettoothrewards.com>
28
+ */
29
+ class TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show
30
+ {
31
+ public function toOptionArray()
32
+ {
33
+ $collection = $this->_getAttrCol();
34
+
35
+ $cols = array();
36
+ $cols[] = array('value' => 'id', 'label' => 'ID');
37
+ $cols[] = array('value' => 'type_id', 'label' => 'Type (simple, bundle, etc)');
38
+ $cols[] = array('value' => 'attribute_set_id', 'label' => 'Attribute Set');
39
+ $cols[] = array('value' => 'qty', 'label' => 'Quantity');
40
+ $cols[] = array('value' => 'websites', 'label' => 'Websites');
41
+ $cols[] = array('value' => 'categories', 'label' => 'Categories');
42
+ //@nelkaake Tuesday April 27, 2010 :
43
+ $cols[] = array('value' => 'created_at', 'label' => 'Date Created');
44
+ foreach ($collection->getItems() as $col) {
45
+ $cols[] = array('value' => $col->getAttributeCode(), 'label' => $col->getFrontendLabel());
46
+ }
47
+
48
+ return $cols;
49
+ }
50
+
51
+ /**
52
+ * @return Mage_Eav_Model_Mysql4_Entity_Attribute_Collection
53
+ */
54
+ protected function _getAttrCol()
55
+ {
56
+ if (Mage::helper('enhancedgrid/version')->isBaseMageVersionAtLeast('1.4')) {
57
+ $collection = Mage::getResourceModel('catalog/product_attribute_collection');
58
+ } else {
59
+ $type_id = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
60
+ $collection = Mage::getResourceModel('eav/entity_attribute_collection');
61
+ $collection->setEntityTypeFilter($type_id);
62
+ }
63
+
64
+ $collection->addFilter('is_visible', 1);
65
+
66
+ return $collection;
67
+ }
68
+ }
app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Sort/Direction.php CHANGED
@@ -1,12 +1,13 @@
1
- <?php
2
-
3
- class TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction
4
- {
5
- public function toOptionArray()
6
- {
7
- $sorts = array();
8
- $sorts[] = array('value' => 'desc', 'label' => 'Descending');
9
- $sorts[] = array('value' => 'asc', 'label' => 'Ascending');
10
- return $sorts;
11
- }
12
- }
 
1
+ <?php
2
+
3
+ class TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $sorts = array();
8
+ $sorts[] = array('value' => 'desc', 'label' => 'Descending');
9
+ $sorts[] = array('value' => 'asc', 'label' => 'Ascending');
10
+
11
+ return $sorts;
12
+ }
13
+ }
app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php CHANGED
@@ -1,154 +1,178 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Mage
22
- * @package Mage_Adminhtml
23
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
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".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;
38
- protected function _construct()
39
- {
40
- // Define module dependent translate
41
- $this->setUsedModuleName('TBT_Enhancedgrid');
42
- }
43
-
44
- /**
45
- * Product list page
46
- */
47
- public function indexAction()
48
- {
49
- $this->loadLayout();
50
- $this->_setActiveMenu('catalog/enhancedgrid');
51
-
52
- $this->_addContent(
53
- $this->getLayout()->createBlock('enhancedgrid/catalog_product')
54
- );
55
-
56
- $this->renderLayout();
57
- }
58
-
59
- /**
60
- * Product grid for AJAX request
61
- */
62
- public function gridAction()
63
- {
64
- $this->loadLayout();
65
- $this->getResponse()->setBody(
66
- $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')->toHtml()
67
- );
68
- }
69
-
70
- protected function _isAllowed()
71
- {
72
- return Mage::getSingleton('admin/session')->isAllowed('catalog/products');
73
- }
74
-
75
-
76
-
77
- /**
78
- * Export product grid to CSV format
79
- */
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);
87
- }
88
-
89
- /**
90
- * Export product grid to XML format
91
- */
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);
99
- }
100
-
101
-
102
- protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
103
- {
104
- $response = $this->getResponse();
105
- $response->setHeader('HTTP/1.1 200 OK','');
106
-
107
- $response->setHeader('Pragma', 'public', true);
108
- $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
109
-
110
- $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
111
- $response->setHeader('Last-Modified', date('r'));
112
- $response->setHeader('Accept-Ranges', 'bytes');
113
- $response->setHeader('Content-Length', strlen($content));
114
- $response->setHeader('Content-type', $contentType);
115
- $response->setBody($content);
116
- $response->sendResponse();
117
- die;
118
- }
119
-
120
- ///////////////////////////////////////////////////////////////////////////////////////////////
121
- // Mass Functions BEGIN --> /////////////////////////////////////////////////////
122
- ///////////////////////////////////////////////////////////////////////////////////////////////
123
-
124
-
125
- /**
126
- * This will relate all products selected to each other.
127
- *
128
- */
129
- public function massRefreshProductsAction()
130
- {
131
- $productIds = $this->getRequest()->getParam('product');
132
- if (!is_array($productIds)) {
133
- $this->_getSession()->addError($this->__('Please select product(s)'));
134
- }
135
- else {
136
- try {
137
- foreach ($productIds as $productId) {
138
- $product = Mage::getModel('catalog/product')->load($productId);
139
- if ($this->massactionEventDispatchEnabled)
140
- Mage::dispatchEvent('catalog_product_prepare_save',
141
- array('product' => $product, 'request' => $this->getRequest()));
142
- $product->save();
143
- }
144
- $this->_getSession()->addSuccess(
145
- $this->__('Total of %d record(s) were successfully refreshed.', count($productIds))
146
- );
147
- } catch (Exception $e) {
148
- $this->_getSession()->addError($e->getMessage());
149
- }
150
- }
151
- $this->_redirect('*/*/index');
152
- }
153
-
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sweet Tooth.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
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
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
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 Sweet Tooth
22
+ *
23
+ * @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
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 Sweet Tooth @author Jay El-Kaake <jay@sweettoothhq.com>
31
+ */
32
+ include_once 'Mage'.DS.'Adminhtml'.DS.'controllers'.DS.'Catalog'.DS.'ProductController.php';
33
+ class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
34
+ {
35
+ protected $massactionEventDispatchEnabled = true;
36
+ protected function _construct()
37
+ {
38
+ // Define module dependent translate
39
+ $this->setUsedModuleName('TBT_Enhancedgrid');
40
+ }
41
+
42
+ /**
43
+ * Product list page.
44
+ */
45
+ public function indexAction()
46
+ {
47
+ $this->loadLayout();
48
+ $this->_setActiveMenu('catalog/enhancedgrid');
49
+
50
+ $this->_addContent(
51
+ $this->getLayout()->createBlock('enhancedgrid/catalog_product')
52
+ );
53
+
54
+ $this->renderLayout();
55
+ }
56
+
57
+ /**
58
+ * Product grid for AJAX request.
59
+ */
60
+ public function gridAction()
61
+ {
62
+ $this->loadLayout();
63
+ $this->getResponse()->setBody(
64
+ $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')->toHtml()
65
+ );
66
+ }
67
+
68
+ protected function _isAllowed()
69
+ {
70
+ return Mage::getSingleton('admin/session')->isAllowed('catalog/products');
71
+ }
72
+
73
+ /**
74
+ * Export product grid to CSV format.
75
+ */
76
+ public function exportCsvAction()
77
+ {
78
+ $fileName = 'products.csv';
79
+ $content = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
80
+ ->getCsv();
81
+
82
+ $this->_sendUploadResponse($fileName, $content);
83
+ }
84
+
85
+ /**
86
+ * Export product grid to XML format.
87
+ */
88
+ public function exportXmlAction()
89
+ {
90
+ $fileName = 'products.xml';
91
+ $content = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
92
+ ->getXml();
93
+
94
+ $this->_sendUploadResponse($fileName, $content);
95
+ }
96
+
97
+ protected function _sendUploadResponse($fileName, $content, $contentType = 'application/octet-stream')
98
+ {
99
+ $response = $this->getResponse();
100
+ $response->setHeader('HTTP/1.1 200 OK', '');
101
+
102
+ $response->setHeader('Pragma', 'public', true);
103
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
104
+
105
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
106
+ $response->setHeader('Last-Modified', date('r'));
107
+ $response->setHeader('Accept-Ranges', 'bytes');
108
+ $response->setHeader('Content-Length', strlen($content));
109
+ $response->setHeader('Content-type', $contentType);
110
+ $response->setBody($content);
111
+ $response->sendResponse();
112
+ die;
113
+ }
114
+
115
+ ///////////////////////////////////////////////////////////////////////////////////////////////
116
+ // Mass Functions BEGIN --> /////////////////////////////////////////////////////
117
+ ///////////////////////////////////////////////////////////////////////////////////////////////
118
+
119
+
120
+ /**
121
+ * This will relate all products selected to each other.
122
+ */
123
+ public function massRefreshProductsAction()
124
+ {
125
+ $productIds = $this->getRequest()->getParam('product');
126
+ if (!is_array($productIds)) {
127
+ $this->_getSession()->addError($this->__('Please select product(s)'));
128
+ } else {
129
+ try {
130
+ foreach ($productIds as $productId) {
131
+ $product = Mage::getModel('catalog/product')->load($productId);
132
+ if ($this->massactionEventDispatchEnabled) {
133
+ Mage::dispatchEvent('catalog_product_prepare_save',
134
+ array('product' => $product, 'request' => $this->getRequest()));
135
+ }
136
+ $product->save();
137
+ }
138
+ $this->_getSession()->addSuccess(
139
+ $this->__('Total of %d record(s) were successfully refreshed.', count($productIds))
140
+ );
141
+ } catch (Exception $e) {
142
+ $this->_getSession()->addError($e->getMessage());
143
+ }
144
+ }
145
+ $this->_redirect('*/*/index');
146
+ }
147
+
148
+ // Added by Tegan Snyder.
149
+ public function changeattributesetAction()
150
+ {
151
+ $productIds = $this->getRequest()->getParam('product');
152
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
153
+
154
+ if (!is_array($productIds)) {
155
+ $this->_getSession()->addError($this->__('Please select product(s)'));
156
+ } else {
157
+ try {
158
+ foreach ($productIds as $productId) {
159
+ $product = Mage::getSingleton('catalog/product')
160
+ ->unsetData()
161
+ ->setStoreId($storeId)
162
+ ->load($productId)
163
+ ->setAttributeSetId($this->getRequest()->getParam('attribute_set'))
164
+ ->setIsMassupdate(true)
165
+ ->save();
166
+ }
167
+
168
+ Mage::dispatchEvent('catalog_product_massupdate_after', array('products' => $productIds));
169
+ $this->_getSession()->addSuccess(
170
+ $this->__('Total of %d record(s) were successfully updated', count($productIds)));
171
+ } catch (Exception $e) {
172
+ $this->_getSession()->addError($e->getMessage());
173
+ }
174
+ }
175
+
176
+ $this->_redirect('*/*/', array('store' => (int) $this->getRequest()->getParam('store', 0)));
177
+ }
178
+ }
app/code/community/TBT/Enhancedgrid/etc/config.xml CHANGED
@@ -1,163 +1,138 @@
1
- <?xml version="1.0"?>
2
-
3
- <config>
4
- <modules>
5
- <TBT_Enhancedgrid>
6
- <version>1.3.2.1</version>
7
- </TBT_Enhancedgrid>
8
- </modules>
9
- <admin>
10
- <routers>
11
- <enhancedgrid>
12
- <!-- should be set to "admin" when overloading admin stuff (?) -->
13
- <use>admin</use>
14
- <args>
15
- <module>TBT_Enhancedgrid</module>
16
- <!-- This is used when "catching" the rewrite above -->
17
- <frontName>enhancedgrid</frontName>
18
- </args>
19
- </enhancedgrid>
20
- </routers>
21
- </admin>
22
-
23
- <global>
24
- <blocks>
25
- <enhancedgrid>
26
- <class>TBT_Enhancedgrid_Block</class>
27
- </enhancedgrid>
28
- </blocks>
29
- <helpers>
30
- <enhancedgrid>
31
- <class>TBT_Enhancedgrid_Helper</class>
32
- </enhancedgrid>
33
- </helpers>
34
- <blocks>
35
- <adminhtml>
36
- <rewrite>
37
- <widget_grid_column>TBT_Enhancedgrid_Block_Widget_Grid_Column</widget_grid_column>
38
- <catalog_product>TBT_Enhancedgrid_Block_Catalog_Product</catalog_product>
39
- </rewrite>
40
- </adminhtml>
41
- </blocks>
42
-
43
- <models>
44
- <enhancedgrid>
45
- <class>TBT_Enhancedgrid_Model</class>
46
- </enhancedgrid>
47
- </models>
48
-
49
- <resources>
50
- <enhancedgrid_setup>
51
- <setup>
52
- <module>TBT_Enhancedgrid</module>
53
- </setup>
54
- <connection>
55
- <use>core_setup</use>
56
- </connection>
57
- </enhancedgrid_setup>
58
- <enhancedgrid_write>
59
- <connection>
60
- <use>core_write</use>
61
- </connection>
62
- </enhancedgrid_write>
63
- <enhancedgrid_read>
64
- <connection>
65
- <use>core_read</use>
66
- </connection>
67
- </enhancedgrid_read>
68
- </resources>
69
-
70
- <rewrite>
71
- <!-- @nelkaake -a 13/11/10: Added for Magento 1.4 compatibility -->
72
- <tbt_enhancedgrid_catalog_product_export_csv>
73
- <from><![CDATA[#^/admin/catalog_product/((exportCsv.*))/$#]]></from>
74
- <to>/enhancedgrid/catalog_product/${1}/</to>
75
- </tbt_enhancedgrid_catalog_product_export_csv>
76
- <tbt_enhancedgrid_catalog_product_export_xml>
77
- <from><![CDATA[#^/admin/catalog_product/((exportXml.*))/$#]]></from>
78
- <to>/enhancedgrid/catalog_product/${1}/</to>
79
- </tbt_enhancedgrid_catalog_product_export_xml>
80
- <tbt_enhancedgrid_catalog_product>
81
- <from><![CDATA[#^/adminhtml/catalog_product/((massProd.*))/$#]]></from>
82
- <to>/enhancedgrid/catalog_product/${1}/</to>
83
- </tbt_enhancedgrid_catalog_product>
84
- </rewrite>
85
- </global>
86
-
87
- <adminhtml>
88
- <layout>
89
- <updates>
90
- <enhancedgrid>
91
- <file>tbt_enhancedgrid.xml</file>
92
- </enhancedgrid>
93
- </updates>
94
- </layout>
95
- <menu>
96
- <catalog module="enhancedgrid">
97
- <children>
98
- <products module="enhancedgrid" translate="title">
99
- <title>Manage Products*</title>
100
- <sort_order>0</sort_order>
101
- <action>enhancedgrid/catalog_product</action>
102
- </products>
103
- </children>
104
- </catalog>
105
- </menu>
106
- </adminhtml>
107
-
108
- <default>
109
- <enhancedgrid>
110
- <general>
111
- <isenabled>1</isenabled>
112
- </general>
113
- <columns>
114
- <showcolumns>id,name,type_id,attribute_set_id,sku,price,qty,visibility,status,websites,thumbnail</showcolumns>
115
- <truncatelongtextafter>60</truncatelongtextafter>
116
- </columns>
117
- <images>
118
- <showurl>0</showurl>
119
- <showbydefault>1</showbydefault>
120
- <width>75</width>
121
- <height>75</height>
122
- </images>
123
- <defaults>
124
- <limit>20</limit>
125
- <page>1</page>
126
- <sort>id</sort>
127
- <dir>desc</dir>
128
- </defaults>
129
- </enhancedgrid>
130
- </default>
131
-
132
- <adminhtml>
133
- <acl>
134
- <resources>
135
- <all>
136
- <title>Allow Everything</title>
137
- </all>
138
- <admin>
139
- <children>
140
- <catalog>
141
- <children>
142
- <enhancedgrid>
143
- <title>Enhanced Product Grid</title>
144
- </enhancedgrid>
145
- </children>
146
- </catalog>
147
- <system>
148
- <children>
149
- <config>
150
- <children>
151
- <enhancedgrid>
152
- <title>Enhanced Grid Config</title>
153
- </enhancedgrid>
154
- </children>
155
- </config>
156
- </children>
157
- </system>
158
- </children>
159
- </admin>
160
- </resources>
161
- </acl>
162
- </adminhtml>
163
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <TBT_Enhancedgrid>
5
+ <version>1.3.4.1</version>
6
+ </TBT_Enhancedgrid>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <adminhtml>
11
+ <args>
12
+ <modules>
13
+ <TBT_Enhancedgrid before="Mage_Adminhtml">TBT_Enhancedgrid</TBT_Enhancedgrid>
14
+ </modules>
15
+ </args>
16
+ </adminhtml>
17
+ </routers>
18
+ </admin>
19
+ <global>
20
+ <blocks>
21
+ <enhancedgrid>
22
+ <class>TBT_Enhancedgrid_Block</class>
23
+ </enhancedgrid>
24
+ </blocks>
25
+ <helpers>
26
+ <enhancedgrid>
27
+ <class>TBT_Enhancedgrid_Helper</class>
28
+ </enhancedgrid>
29
+ </helpers>
30
+ <blocks>
31
+ <adminhtml>
32
+ <rewrite>
33
+ <widget_grid_column>TBT_Enhancedgrid_Block_Widget_Grid_Column</widget_grid_column>
34
+ <catalog_product>TBT_Enhancedgrid_Block_Catalog_Product</catalog_product>
35
+ </rewrite>
36
+ </adminhtml>
37
+ </blocks>
38
+ <models>
39
+ <enhancedgrid>
40
+ <class>TBT_Enhancedgrid_Model</class>
41
+ </enhancedgrid>
42
+ </models>
43
+ <resources>
44
+ <enhancedgrid_setup>
45
+ <setup>
46
+ <module>TBT_Enhancedgrid</module>
47
+ </setup>
48
+ <connection>
49
+ <use>core_setup</use>
50
+ </connection>
51
+ </enhancedgrid_setup>
52
+ <enhancedgrid_write>
53
+ <connection>
54
+ <use>core_write</use>
55
+ </connection>
56
+ </enhancedgrid_write>
57
+ <enhancedgrid_read>
58
+ <connection>
59
+ <use>core_read</use>
60
+ </connection>
61
+ </enhancedgrid_read>
62
+ </resources>
63
+ </global>
64
+ <adminhtml>
65
+ <layout>
66
+ <updates>
67
+ <enhancedgrid>
68
+ <file>tbt_enhancedgrid.xml</file>
69
+ </enhancedgrid>
70
+ </updates>
71
+ </layout>
72
+ <menu>
73
+ <catalog module="enhancedgrid">
74
+ <children>
75
+ <products module="enhancedgrid" translate="title">
76
+ <title>Manage Products*</title>
77
+ <sort_order>0</sort_order>
78
+ <action>adminhtml/catalog_product</action>
79
+ </products>
80
+ </children>
81
+ </catalog>
82
+ </menu>
83
+ </adminhtml>
84
+ <default>
85
+ <enhancedgrid>
86
+ <general>
87
+ <isenabled>1</isenabled>
88
+ </general>
89
+ <columns>
90
+ <showcolumns>id,name,type_id,sku,price,qty,visibility,status,websites,thumbnail</showcolumns>
91
+ <truncatelongtextafter>60</truncatelongtextafter>
92
+ </columns>
93
+ <images>
94
+ <showurl>0</showurl>
95
+ <showbydefault>1</showbydefault>
96
+ <width>75</width>
97
+ <height>75</height>
98
+ </images>
99
+ <defaults>
100
+ <limit>20</limit>
101
+ <page>1</page>
102
+ <sort>id</sort>
103
+ <dir>desc</dir>
104
+ </defaults>
105
+ </enhancedgrid>
106
+ </default>
107
+ <adminhtml>
108
+ <acl>
109
+ <resources>
110
+ <all>
111
+ <title>Allow Everything</title>
112
+ </all>
113
+ <admin>
114
+ <children>
115
+ <catalog>
116
+ <children>
117
+ <enhancedgrid>
118
+ <title>Enhanced Product Grid</title>
119
+ </enhancedgrid>
120
+ </children>
121
+ </catalog>
122
+ <system>
123
+ <children>
124
+ <config>
125
+ <children>
126
+ <enhancedgrid>
127
+ <title>Enhanced Grid Config</title>
128
+ </enhancedgrid>
129
+ </children>
130
+ </config>
131
+ </children>
132
+ </system>
133
+ </children>
134
+ </admin>
135
+ </resources>
136
+ </acl>
137
+ </adminhtml>
138
+ </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/TBT/Enhancedgrid/etc/system.xml CHANGED
@@ -1,182 +1,142 @@
1
-
2
- <config>
3
-
4
- <tabs>
5
- <tbtall translate="label" module="enhancedgrid">
6
- <label>WDCA Extensions</label>
7
- <sort_order>900</sort_order>
8
- </tbtall>
9
- </tabs>
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>
16
- <show_in_default>1</show_in_default>
17
- <show_in_website>1</show_in_website>
18
- <show_in_store>0</show_in_store>
19
- <groups>
20
- <about translate="label">
21
- <label>About This Extension</label>
22
- <sort_order>100</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <fields>
26
- <notice translate="label">
27
- <label>Extension Information Provided By WWW.WDCA.CA</label>
28
- <frontend_type>text</frontend_type>
29
- <frontend_model>enhancedgrid/system_html</frontend_model>
30
- <sort_order>10</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- </notice>
35
- </fields>
36
- </about>
37
- <columns translate="label">
38
- <label>Column Options</label>
39
- <sort_order>200</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <fields>
43
- <showcolumns translate="label">
44
- <label>Show Columns</label>
45
- <frontend_type>multiselect</frontend_type>
46
- <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show</source_model>
47
- <sort_order>20</sort_order>
48
- <show_in_default>1</show_in_default>
49
- <show_in_website>1</show_in_website>
50
- </showcolumns>
51
- <truncatelongtextafter translate="label">
52
- <label>Truncate Long Texts After X Characters </label>
53
- <frontend_type>text</frontend_type>
54
- <sort_order>30</sort_order>
55
- <show_in_default>1</show_in_default>
56
- <show_in_website>1</show_in_website>
57
- </truncatelongtextafter>
58
- <!--showimages translate="label">
59
- <label>Show Product Images</label>
60
- <frontend_type>select</frontend_type>
61
- <source_model>adminhtml/system_config_source_yesno</source_model>
62
- <sort_order>30</sort_order>
63
- <show_in_default>1</show_in_default>
64
- <show_in_website>1</show_in_website>
65
- </showimages-->
66
- </fields>
67
- </columns>
68
- <images translate="label">
69
- <label>In-Grid Image Options</label>
70
- <sort_order>300</sort_order>
71
- <show_in_default>1</show_in_default>
72
- <show_in_website>1</show_in_website>
73
- <fields>
74
- <showurl translate="label comment">
75
- <label>Show Image Url</label>
76
- <comment>(When product image is hidden for that row)</comment>
77
- <frontend_type>select</frontend_type>
78
- <source_model>adminhtml/system_config_source_yesno</source_model>
79
- <sort_order>10</sort_order>
80
- <show_in_default>1</show_in_default>
81
- <show_in_website>1</show_in_website>
82
- </showurl>
83
- <showbydefault translate="label comment">
84
- <label>Show Image By Default</label>
85
- <comment>If your grid has a large page size by default this could get slow.</comment>
86
- <frontend_type>select</frontend_type>
87
- <source_model>adminhtml/system_config_source_yesno</source_model>
88
- <sort_order>20</sort_order>
89
- <show_in_default>1</show_in_default>
90
- <show_in_website>1</show_in_website>
91
- </showbydefault>
92
- <width translate="label comment">
93
- <label>Image Width</label>
94
- <frontend_type>text</frontend_type>
95
- <sort_order>30</sort_order>
96
- <show_in_default>1</show_in_default>
97
- <show_in_website>1</show_in_website>
98
- </width>
99
- <height translate="label comment">
100
- <label>Image Height</label>
101
- <frontend_type>text</frontend_type>
102
- <sort_order>40</sort_order>
103
- <show_in_default>1</show_in_default>
104
- <show_in_website>1</show_in_website>
105
- </height>
106
- </fields>
107
- </images>
108
- <defaults translate="label">
109
- <label>Default Grid State</label>
110
- <sort_order>400</sort_order>
111
- <show_in_default>1</show_in_default>
112
- <show_in_website>1</show_in_website>
113
- <fields>
114
- <limit translate="label">
115
- <label>Page Size</label>
116
- <frontend_type>text</frontend_type>
117
- <sort_order>10</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>1</show_in_website>
120
- </limit>
121
- <page translate="label">
122
- <label>Initial Page Number</label>
123
- <frontend_type>text</frontend_type>
124
- <sort_order>10</sort_order>
125
- <show_in_default>1</show_in_default>
126
- <show_in_website>1</show_in_website>
127
- </page>
128
- <sort translate="label comment">
129
- <label>Sort Column</label>
130
- <comment>The selected column must be also selected above if it's not already there</comment>
131
- <frontend_type>select</frontend_type>
132
- <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show</source_model>
133
- <sort_order>10</sort_order>
134
- <show_in_default>1</show_in_default>
135
- <show_in_website>1</show_in_website>
136
- </sort>
137
- <dir translate="label">
138
- <label>Sort Column Direction</label>
139
- <frontend_type>select</frontend_type>
140
- <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction</source_model>
141
- <sort_order>10</sort_order>
142
- <show_in_default>1</show_in_default>
143
- <show_in_website>1</show_in_website>
144
- </dir>
145
- </fields>
146
- </defaults>
147
- <!--export translate="label">
148
- <label>Products Grid Export</label>
149
- <sort_order>200</sort_order>
150
- <show_in_default>1</show_in_default>
151
- <show_in_website>1</show_in_website>
152
- <fields>
153
- <isenabled translate="label">
154
- <label>Enable Quick Export</label>
155
- <frontend_type>select</frontend_type>
156
- <source_model>adminhtml/system_config_source_yesno</source_model>
157
- <sort_order>10</sort_order>
158
- <show_in_default>1</show_in_default>
159
- <show_in_website>1</show_in_website>
160
- </isenabled>
161
- </fields>
162
- </export-->
163
- <!--search translate="label">
164
- <label>Products Grid Search</label>
165
- <sort_order>300</sort_order>
166
- <show_in_default>1</show_in_default>
167
- <show_in_website>1</show_in_website>
168
- <fields>
169
- <isenabled translate="label">
170
- <label>Enable Fulltext Search</label>
171
- <frontend_type>select</frontend_type>
172
- <source_model>adminhtml/system_config_source_yesno</source_model>
173
- <sort_order>50</sort_order>
174
- <show_in_default>1</show_in_default>
175
- <show_in_website>1</show_in_website>
176
- </isenabled>
177
- </fields>
178
- </search-->
179
- </groups>
180
- </enhancedgrid>
181
- </sections>
182
- </config>
1
+
2
+ <config>
3
+
4
+ <tabs>
5
+ <tbtall translate="label" module="enhancedgrid">
6
+ <label>Sweet Tooth Extensions</label>
7
+ <sort_order>900</sort_order>
8
+ </tbtall>
9
+ </tabs>
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>145</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>0</show_in_store>
19
+ <groups>
20
+ <about translate="label">
21
+ <label>About This Extension</label>
22
+ <sort_order>100</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <fields>
26
+ <notice translate="label">
27
+ <label>See https://github.com/jayelkaake/enhancedgrid for more information about this extension and to contribute.</label>
28
+ <frontend_type>text</frontend_type>
29
+ <frontend_model>enhancedgrid/system_html</frontend_model>
30
+ <sort_order>10</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ </notice>
35
+ </fields>
36
+ </about>
37
+ <columns translate="label">
38
+ <label>Column Options</label>
39
+ <sort_order>200</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <fields>
43
+ <showcolumns translate="label">
44
+ <label>Show Columns</label>
45
+ <frontend_type>multiselect</frontend_type>
46
+ <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show</source_model>
47
+ <sort_order>20</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ </showcolumns>
51
+ <truncatelongtextafter translate="label">
52
+ <label>Truncate Long Texts After X Characters </label>
53
+ <frontend_type>text</frontend_type>
54
+ <sort_order>30</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ </truncatelongtextafter>
58
+ </fields>
59
+ </columns>
60
+ <images translate="label">
61
+ <label>In-Grid Image Options</label>
62
+ <sort_order>300</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <fields>
66
+ <showurl translate="label comment">
67
+ <label>Show Image Url</label>
68
+ <comment>(When product image is hidden for that row)</comment>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>adminhtml/system_config_source_yesno</source_model>
71
+ <sort_order>10</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ </showurl>
75
+ <showbydefault translate="label comment">
76
+ <label>Show Image By Default</label>
77
+ <comment>If your grid has a large page size by default this could get slow.</comment>
78
+ <frontend_type>select</frontend_type>
79
+ <source_model>adminhtml/system_config_source_yesno</source_model>
80
+ <sort_order>20</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ </showbydefault>
84
+ <width translate="label comment">
85
+ <label>Image Width</label>
86
+ <frontend_type>text</frontend_type>
87
+ <sort_order>30</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ </width>
91
+ <height translate="label comment">
92
+ <label>Image Height</label>
93
+ <frontend_type>text</frontend_type>
94
+ <sort_order>40</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ </height>
98
+ </fields>
99
+ </images>
100
+ <defaults translate="label">
101
+ <label>Default Grid State</label>
102
+ <sort_order>400</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <fields>
106
+ <limit translate="label">
107
+ <label>Page Size</label>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>10</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ </limit>
113
+ <page translate="label">
114
+ <label>Initial Page Number</label>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>10</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ </page>
120
+ <sort translate="label comment">
121
+ <label>Sort Column</label>
122
+ <comment>The selected column must be also selected above if it's not already there</comment>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show</source_model>
125
+ <sort_order>10</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ </sort>
129
+ <dir translate="label">
130
+ <label>Sort Column Direction</label>
131
+ <frontend_type>select</frontend_type>
132
+ <source_model>TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction</source_model>
133
+ <sort_order>10</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ </dir>
137
+ </fields>
138
+ </defaults>
139
+ </groups>
140
+ </enhancedgrid>
141
+ </sections>
142
+ </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/TBT/Enhancedgrid/sql/enhancedgrid_setup/mysql4-install-1.0.0.0.php CHANGED
@@ -1,26 +1,25 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
- $install_version = Mage::getConfig ()->getNode ( 'modules/TBT_Enhancedgrid/version' );
7
-
8
- $msg_title = "Enhanced Grid {$install_version} was successfully installed! Remember to flush all cache, recompile and log-out and log back in.";
9
- $msg_desc = "Enhanced Grid {$install_version} was successfully installed on your store. "
10
- . "Remember to flush all cache, recompile and log-out and log back in. "
11
- . "The new Enhanced Products Grid replaces the default Magento product management grid."
12
- . "You can configure Enhanced Grid in the Configuration section.";
13
- $url = "#";
14
-
15
- $message = Mage::getModel( 'adminnotification/inbox' );
16
- $message->setDateAdded( date( "c", time() ) );
17
-
18
- $message->setSeverity( Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE );
19
-
20
- $message->setTitle( $msg_title );
21
- $message->setDescription( $msg_desc );
22
- $message->setUrl( $url );
23
- $message->save();
24
-
25
- $installer->endSetup();
26
-
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+ $install_version = Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version');
7
+
8
+ $msg_title = "Enhanced Grid {$install_version} was successfully installed! Remember to flush all cache, recompile and log-out and log back in.";
9
+ $msg_desc = "Enhanced Grid {$install_version} was successfully installed on your store. "
10
+ .'Remember to flush all cache, recompile and log-out and log back in. '
11
+ .'The new Enhanced Products Grid replaces the default Magento product management grid.'
12
+ .'You can configure Enhanced Grid in the Configuration section.';
13
+ $url = '#';
14
+
15
+ $message = Mage::getModel('adminnotification/inbox');
16
+ if ($message) {
17
+ $message->setDateAdded(date('c', time()));
18
+ $message->setSeverity(Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE);
19
+ $message->setTitle($msg_title);
20
+ $message->setDescription($msg_desc);
21
+ $message->setUrl($url);
22
+ $message->save();
23
+ }
24
+
25
+ $installer->endSetup();
 
app/design/adminhtml/default/default/layout/tbt_enhancedgrid.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
- * WDCA
5
  *
6
  * NOTICE OF LICENSE
7
  *
@@ -13,9 +13,9 @@
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
- * @category WDCA
17
  * @package TBT_Enhancedgrid
18
- * @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
  -->
@@ -30,4 +30,4 @@
30
  </reference>
31
  </default>
32
 
33
- </layout>
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
+ * Sweet Tooth
5
  *
6
  * NOTICE OF LICENSE
7
  *
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
+ * @category Sweet Tooth
17
  * @package TBT_Enhancedgrid
18
+ * @copyright Copyright (c) 2008-2010 Sweet Tooth (http://www.sweettoothrewards.com)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
  -->
30
  </reference>
31
  </default>
32
 
33
+ </layout>
app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product.phtml DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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 design_default
22
- * @package Mage
23
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <div class="content-header">
28
- <table cellspacing="0">
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 Mage::getBlockSingleton('enhancedgrid/widget_loyalty')->toHtml(); ?>
33
- <?php echo $this->getAddNewButtonHtml() ?>
34
- </td>
35
- </tr>
36
- </table>
37
- </div>
38
- <?php echo $this->getStoreSwitcherHtml() ?>
39
- <?php /* @nelkaake -a 16/11/10: for MAGE 1.3.2 and up */ ?>
40
- <?php if( !$this->isSingleStoreMode() ): ?>
41
- <?php echo $this->getChildHtml('store_switcher');?>
42
- <?php endif;?>
43
- <div>
44
- <?php echo $this->getGridHtml() ?>
45
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product/grid.phtml DELETED
@@ -1,192 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
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
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
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 design_default
22
- * @package Mage
23
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php
28
- /**
29
- * Template for Mage_Adminhtml_Block_Widget_Grid
30
- *
31
- * getId()
32
- * getCollection()
33
- * getColumns()
34
- * getPagerVisibility()
35
- * getVarNamePage()
36
- */
37
- $numColumns = sizeof($this->getColumns());
38
- ?>
39
- <?php if($this->getCollection()): ?>
40
- <?php if($this->canDisplayContainer()): ?>
41
- <?php if($this->getGridHeader()): ?>
42
- <div class="content-header">
43
- <table cellspacing="0">
44
- <tr>
45
- <td style="width:50%;"><h2><?php echo $this->getGridHeader(); ?></h2></td>
46
- </tr>
47
- </table>
48
- </div>
49
- <?php endif ?>
50
-
51
- <div id="<?php echo $this->getId() ?>">
52
- <?php else: ?>
53
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
54
- <?php endif; ?>
55
- <?php if($this->getPagerVisibility() || $this->getExportTypes() || $this->getFilterVisibility()): ?>
56
- <table cellspacing="0" class="actions">
57
- <tr>
58
- <?php if($this->getPagerVisibility()): ?>
59
- <td class="pager">
60
- <?php echo $this->__('Page') ?>
61
-
62
- <?php $_curPage = $this->getCollection()->getCurPage() ?>
63
- <?php $_lastPage = $this->getCollection()->getLastPageNumber() ?>
64
- <?php if($_curPage>1): ?>
65
- <a href="#" title="<?php echo $this->__('Previous page') ?>" onclick="<?php echo $this->getId() ?>JsObject.setPage('<?php echo ($_curPage-1) ?>');return false;"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="Go to Previous page" class="arrow"/></a>
66
- <?php else: ?>
67
- <img src="<?php echo $this->getSkinUrl('images/pager_arrow_left_off.gif') ?>" alt="Go to Previous page" class="arrow"/>
68
- <?php endif; ?>
69
-
70
- <input type="text" name="<?php echo $this->getVarNamePage() ?>" value="<?php echo $_curPage ?>" class="input-text page" onkeypress="<?php echo $this->getId() ?>JsObject.inputPage(event, '<?php echo $_lastPage ?>')"/>
71
-
72
- <?php if($_curPage < $_lastPage): ?>
73
- <a href="#" title="<?php echo $this->__('Next page') ?>" onclick="<?php echo $this->getId() ?>JsObject.setPage('<?php echo ($_curPage+1) ?>');return false;"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="Go to Next page" class="arrow"/></a>
74
- <?php else: ?>
75
- <img src="<?php echo $this->getSkinUrl('images/pager_arrow_right_off.gif') ?>" alt="Go to Previous page" class="arrow"/>
76
- <?php endif; ?>
77
-
78
- <?php echo $this->__('of %s pages', $this->getCollection()->getLastPageNumber()) ?>
79
- <span class="separator">|</span>
80
- <?php echo $this->__('View') ?>
81
- <select name="<?php echo $this->getVarNameLimit() ?>" onchange="<?php echo $this->getId() ?>JsObject.loadByElement(this)">
82
- <option value="20"<?php if($this->getCollection()->getPageSize()==20): ?> selected="selected"<?php endif; ?>>20</option>
83
- <option value="30"<?php if($this->getCollection()->getPageSize()==30): ?> selected="selected"<?php endif; ?>>30</option>
84
- <option value="50"<?php if($this->getCollection()->getPageSize()==50): ?> selected="selected"<?php endif; ?>>50</option>
85
- <option value="100"<?php if($this->getCollection()->getPageSize()==100): ?> selected="selected"<?php endif; ?>>100</option>
86
- <option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option>
87
- </select>
88
- <?php echo $this->__('per page') ?><span class="separator">|</span>
89
- <?php echo $this->__('Total %d records found', $this->getCollection()->getSize()) ?>
90
- <span id="<?php echo $this->getHtmlId() ?>-total-count" class="no-display"><?php echo $this->getCollection()->getSize() ?></span>
91
- <?php if($this->getRssLists()): ?>
92
- <?php foreach ($this->getRssLists() as $_rss): ?>
93
- <span class="separator">|</span><a href="<?php echo $_rss->getUrl() ?>" class="link-feed"><?php echo $_rss->getLabel() ?></a>
94
- <?php endforeach ?>
95
- <?php endif; ?>
96
- </td>
97
- <?php endif ?>
98
- <?php if($this->getExportTypes()): ?>
99
- <td class="export a-right">
100
- <img src="<?php echo $this->getSkinUrl('images/icon_export.gif') ?>" alt="" class="v-middle"/>&nbsp; <?php echo $this->__('Export to:') ?>
101
- <select name="<?php echo $this->getId() ?>_export" id="<?php echo $this->getId() ?>_export" style="width:8em;">
102
- <?php foreach ($this->getExportTypes() as $_type): ?>
103
- <option value="<?php echo $_type->getUrl() ?>"><?php echo $_type->getLabel() ?></option>
104
- <?php endforeach; ?>
105
- </select>
106
- <?php echo $this->getExportButtonHtml() ?>
107
- </td>
108
- <?php endif; ?>
109
- <td class="filter-actions a-right">
110
- <input type="text" value="<?php echo $this->getQueryStr(); ?>" id="enhancedGridSearchQry" onkeypress="if(keyWasPressed(event, 13)) { productGridJsObject.doFilter(); }">
111
- <?php echo $this->getMainButtonsHtml() ?>
112
- </td>
113
- </tr>
114
- </table>
115
- <?php endif; ?>
116
- <?php if($this->getMassactionBlock()->isAvailable()): ?>
117
- <?php echo $this->getMassactionBlockHtml() ?>
118
- <?php endif ?>
119
- <div class="grid">
120
- <div class="hor-scroll">
121
- <table cellspacing="0" class="data" id="<?php echo $this->getId() ?>_table">
122
- <?php foreach ($this->getColumns() as $_column): ?>
123
- <col <?php echo $_column->getHtmlProperty() ?> />
124
- <?php endforeach; ?>
125
- <?php if ($this->getHeadersVisibility() || $this->getFilterVisibility()): ?>
126
- <thead>
127
- <?php if ($this->getHeadersVisibility()): ?>
128
- <tr class="headings">
129
- <?php foreach ($this->getColumns() as $_column): ?>
130
- <th<?php echo $_column->getHeaderHtmlProperty() ?>><span class="nobr"><?php echo $_column->getHeaderHtml() ?></span></th>
131
- <?php endforeach; ?>
132
- </tr>
133
- <?php endif; ?>
134
- <?php if ($this->getFilterVisibility()): ?>
135
- <tr class="filter">
136
- <?php $i=0;foreach ($this->getColumns() as $_column): ?>
137
- <th<?php echo $_column->getHeaderHtmlProperty() ?>><?php echo $_column->getFilterHtml() ?></th>
138
- <?php endforeach; ?>
139
- </tr>
140
- <?php endif ?>
141
- </thead>
142
- <?php endif; ?>
143
- <?php if ($this->getCountTotals()): ?>
144
- <tfoot>
145
- <tr>
146
- <?php foreach ($this->getColumns() as $_column): ?>
147
- <th class="<?php echo $_column->getCssProperty() ?>"><?php echo $_column->getRowField($_column->getGrid()->getTotals()) ?>&nbsp;</th>
148
- <?php endforeach; ?>
149
- </tr>
150
- </tfoot>
151
- <?php endif; ?>
152
- <tbody>
153
- <?php if (($this->getCollection()->getSize()>0) && (!$this->getIsCollapsed())): ?>
154
- <?php foreach ($this->getCollection() as $_index=>$_item): ?>
155
- <tr title="<?php echo $this->getRowUrl($_item) ?>"<?php if ($_class = $this->getRowClass($_item)):?> class="<?php echo $_class; ?>"<?php endif;?> >
156
- <?php $i=0;foreach ($this->getColumns() as $_column): ?>
157
- <td class="<?php echo $_column->getCssProperty() ?> <?php echo ++$i==$numColumns?'last':'' ?>"><?php echo (($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?></td>
158
- <?php endforeach; ?>
159
- </tr>
160
- <?php endforeach; ?>
161
- <?php elseif ($this->getEmptyText()): ?>
162
- <tr>
163
- <td class="empty-text <?php echo $this->getEmptyTextClass() ?>" colspan="100"><?php echo $this->getEmptyText() ?></td>
164
- </tr>
165
- <?php endif; ?>
166
- </tbody>
167
- </table>
168
- </div>
169
- </div>
170
- <?php if($this->canDisplayContainer()): ?>
171
- </div>
172
- <script type="text/javascript">
173
- //<![CDATA[
174
- <?php echo $this->getJsObjectName() ?> = new varienGrid('<?php echo $this->getId() ?>', '<?php echo $this->getGridUrl() ?>', '<?php echo $this->getVarNamePage() ?>', '<?php echo $this->getVarNameSort() ?>', '<?php echo $this->getVarNameDir() ?>', '<?php echo $this->getVarNameFilter() ?>');
175
- <?php echo $this->getJsObjectName() ?>.useAjax = '<?php echo $this->getUseAjax() ?>';
176
- <?php if($this->getRowClickCallback()): ?>
177
- <?php echo $this->getJsObjectName() ?>.rowClickCallback = <?php echo $this->getRowClickCallback() ?>;
178
- <?php endif; ?>
179
- <?php if($this->getCheckboxCheckCallback()): ?>
180
- <?php echo $this->getJsObjectName() ?>.checkboxCheckCallback = <?php echo $this->getCheckboxCheckCallback() ?>;
181
- <?php endif; ?>
182
- <?php if($this->getRowInitCallback()): ?>
183
- <?php echo $this->getJsObjectName() ?>.initRowCallback = <?php echo $this->getRowInitCallback() ?>;
184
- <?php echo $this->getJsObjectName() ?>.rows.each(function(row){<?php echo $this->getRowInitCallback() ?>(<?php echo $this->getJsObjectName() ?>, row)});
185
- <?php endif; ?>
186
- <?php if($this->getMassactionBlock()->isAvailable()): ?>
187
- <?php echo $this->getMassactionBlock()->getJavaScript() ?>
188
- <?php endif ?>
189
- //]]>
190
- </script>
191
- <?php endif; ?>
192
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/TBT_Enhancedgrid.xml CHANGED
@@ -6,4 +6,4 @@
6
  <codePool>community</codePool>
7
  </TBT_Enhancedgrid>
8
  </modules>
9
- </config>
6
  <codePool>community</codePool>
7
  </TBT_Enhancedgrid>
8
  </modules>
9
+ </config>
js/tbt/enhancedgrid/customfunctions/catalog_products.js DELETED
@@ -1,112 +0,0 @@
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"
20
- +"related to A and B, Y will be related to A and B, etc.\n"
21
- +"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
22
- if (productids == "" || productids == null) {
23
- return null
24
- }
25
- if (!window.confirm("Are you sure you'd like to one-way relate selected grid products to products ("+ productids +")")) {
26
- return null
27
- }
28
- return productids;
29
- }
30
- function chooseWhatToCrossSellTo() {
31
- var productids = window.prompt("Enter the id's for products you'd like to add as cross-sell to the currently selected products.\n"
32
- +"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n"
33
- +"cross-sold to A and B, Y will be cross-sold with A and with B, etc.\n"
34
- +"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
35
- if (productids == "" || productids == null) {
36
- return null
37
- }
38
- if (!window.confirm("Are you sure you'd like to one-way cross-sell products ("+ productids +") to selected grid products?")) {
39
- return null
40
- }
41
- return productids;
42
- }
43
-
44
- function chooseWhatToUpSellTo() {
45
- var productids = window.prompt("Enter the id's for products you'd like to add as up-sells to the currently selected products.\n"
46
- +"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, A and B will be\n"
47
- +"up-sells of X , A and B will be up-sells of Y, etc.\n"
48
- +"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
49
- if (productids == "" || productids == null) {
50
- return null
51
- }
52
- if (!window.confirm("Are you sure you'd like add products ("+ productids +") to selected grid products up-sell?")) {
53
- return null
54
- }
55
- return productids;
56
- }
57
-
58
-
59
-
60
- function showSelectedImages(gridObj, checkedValues, imgTemplate) {
61
- var matchCounter = 0;
62
- gridObj.walkSelectedRows(function(ie){
63
- ie.getElementsBySelector('a').each(function(a) {
64
- if(a.id == "imageurl") {
65
- matchCounter++;
66
- a.innerHTML = imgTemplate.replace("{imgurl}", a.getAttribute('url'));
67
- }
68
- });
69
- });
70
- if(matchCounter == 0) {
71
- alert("Either there was no image column, or the image column could not be found");
72
- }
73
- return null;
74
-
75
- }
76
-
77
- function hideSelectedImages(gridObj, checkedValues) {
78
- var matchCounter = 0;
79
- gridObj.walkSelectedRows(function(ie){
80
- ie.getElementsBySelector('a').each(function(a) {
81
- if(a.id == "imageurl") {
82
- matchCounter++;
83
- a.innerHTML = "@";
84
- }
85
- });
86
- });
87
- if(matchCounter == 0) {
88
- alert("Either there was no image column, or the image column could not be found");
89
- }
90
- return null;
91
-
92
- }
93
-
94
- function openAllImages(gridObj, checkedValues) {
95
- gridObj.walkSelectedRows(function(ie){
96
- ie.getElementsBySelector('a').each(function(a) {
97
- if(a.id == "imageurl") {
98
- window.open(a.getAttribute('url'));
99
- }
100
- });
101
- }, 30);
102
- return null;
103
-
104
- }
105
-
106
- function openAll(gridObj, checkedValues) {
107
- gridObj.walkSelectedRows(function(ie){
108
- window.open(ie.id);
109
- }, 20);
110
- return null;
111
-
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/tbt/enhancedgrid/egsupplemental.js DELETED
@@ -1,73 +0,0 @@
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"]
22
-
23
- omitformtags=omitformtags.join("|")
24
-
25
- function disableselect(e){
26
- if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
27
- return false
28
- }
29
-
30
- function reEnable(){
31
- return true
32
- }
33
-
34
- var originalHighlighting = false;
35
-
36
- function disableHighlighting() {
37
- if (typeof document.onselectstart!="undefined") {
38
- originalHighlighting = document.onselectstart;
39
- document.onselectstart=new Function ("return false")
40
- } else{
41
- originalHighlighting = {
42
- down: document.onmousedown,
43
- up: document.onmouseup
44
- }
45
- document.onmousedown=disableselect
46
- document.onmouseup=reEnable
47
- }
48
- }
49
-
50
- function enableHighlighting() {
51
- if (typeof document.onselectstart!="undefined") {
52
- document.onselectstart = originalHighlighting;
53
- } else{
54
- document.onmousedown=originalHighlighting.down;
55
- document.onmouseup=originalHighlighting.up;
56
- }
57
- }
58
-
59
- function keyWasPressed(e, targetKeyNum) {
60
- var keychar;
61
- var numcheck;
62
-
63
- if(window.event) // IE
64
- {
65
- keynum = e.keyCode;
66
- }
67
- else if(e.which) // Netscape/Firefox/Opera
68
- {
69
- keynum = e.which;
70
- }
71
- if(keynum == targetKeyNum) return true;
72
- return false;
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/tbt/enhancedgrid/enhancedgrid.js DELETED
@@ -1,380 +0,0 @@
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
- varienGrid.prototype.initialize = function(containerId, url, pageVar, sortVar, dirVar, filterVar){
20
- this.containerId = containerId;
21
- this.url = url;
22
- this.pageVar = pageVar || false;
23
- this.sortVar = sortVar || false;
24
- this.dirVar = dirVar || false;
25
- this.filterVar = filterVar || false;
26
- this.tableSufix = '_table';
27
- this.useAjax = false;
28
- this.rowClickCallback = false;
29
- this.checkboxCheckCallback = false;
30
- this.preInitCallback = false;
31
- this.initCallback = false;
32
- this.initRowCallback = false;
33
- this.doFilterCallback = false;
34
-
35
- // muliselect row
36
- this.selectedRowEvents = {};
37
- this.doMultiSelect = false;
38
- this.multiSelectFunction = function(events) { this.onMultiSelect(events); };
39
-
40
-
41
- this.reloadParams = false;
42
-
43
- this.trOnMouseOver = this.rowMouseOver.bindAsEventListener(this);
44
- this.trOnMouseOut = this.rowMouseOut.bindAsEventListener(this);
45
- this.trOnMouseUp = this.rowMouseUp.bindAsEventListener(this);
46
- this.trOnMouseDown = this.rowMouseDown.bindAsEventListener(this);
47
- this.trOnMouseMove = this.rowMouseMove.bindAsEventListener(this);
48
- this.trOnClick = this.rowMouseClick.bindAsEventListener(this);
49
- this.trOnDblClick = this.rowMouseDblClick.bindAsEventListener(this);
50
- this.trOnKeyPress = this.keyPress.bindAsEventListener(this);
51
-
52
- this.thLinkOnClick = this.doSort.bindAsEventListener(this);
53
- this.initGrid();
54
- };
55
-
56
-
57
- varienGrid.prototype.initGrid = function(){
58
- if(this.preInitCallback){
59
- this.preInitCallback(this);
60
- }
61
- if($(this.containerId+this.tableSufix)){
62
- this.rows = $$('#'+this.containerId+this.tableSufix+' tbody tr');
63
- for (var row=0; row<this.rows.length; row++) {
64
- if(row%2==0){
65
- Element.addClassName(this.rows[row], 'even');
66
- }
67
- Event.observe(this.rows[row],'mouseover',this.trOnMouseOver);
68
- Event.observe(this.rows[row],'mouseout',this.trOnMouseOut);
69
- Event.observe(this.rows[row],'click',this.trOnClick);
70
- Event.observe(this.rows[row],'dblclick',this.trOnDblClick);
71
- Event.observe(this.rows[row],'mouseup',this.trOnMouseUp);
72
- Event.observe(this.rows[row],'mousedown',this.trOnMouseDown);
73
- Event.observe(this.rows[row],'mousemove',this.trOnMouseMove);
74
-
75
- if(this.initRowCallback){
76
- try {
77
- this.initRowCallback(this, this.rows[row]);
78
- } catch (e) {
79
- if(console) {
80
- console.log(e);
81
- }
82
- }
83
- }
84
- }
85
- }
86
- if(this.sortVar && this.dirVar){
87
- var columns = $$('#'+this.containerId+this.tableSufix+' thead a');
88
-
89
- for(var col=0; col<columns.length; col++){
90
- Event.observe(columns[col],'click',this.thLinkOnClick);
91
- }
92
- }
93
- this.bindFilterFields();
94
- this.bindFieldsChange();
95
- if(this.initCallback){
96
- try {
97
- this.initCallback(this);
98
- }
99
- catch (e) {
100
- if(console) {
101
- console.log(e);
102
- }
103
- }
104
- }
105
- };
106
- varienGrid.prototype.rowMouseOver = function(event){
107
- var element = Event.findElement(event, 'tr');
108
- Element.addClassName(element, 'on-mouse');
109
-
110
- if (!Element.hasClassName('pointer')
111
- && (this.rowClickCallback !== openGridRow || element.id)) {
112
- Element.addClassName(element, 'pointer');
113
- }
114
- if(this.doMultiSelect) {
115
- if (this.addMultiSelectedRow(event, element)) {
116
- // row is already selected...
117
- } else {
118
- Element.addClassName(element, 'multiselect')
119
- }
120
- }
121
- };
122
- varienGrid.prototype.rowMouseMove = function(event){
123
- };
124
- varienGrid.prototype.addMultiSelectedRow = function(event, rowElement) {
125
- var checkbox = this.findCheckbox(event);
126
- var newId = checkbox.value;
127
- if(this.selectedRowEvents[newId] != null) {
128
- return false;
129
- }
130
- this.selectedRowEvents[newId] = {
131
- event: event,
132
- rowElement: rowElement,
133
- checkbox: checkbox
134
- };
135
- };
136
- varienGrid.prototype.findCheckbox = function(evt) {
137
- if(['a', 'input', 'select'].indexOf(Event.element(evt).tagName.toLowerCase())!==-1) {
138
- return false;
139
- }
140
- checkbox = false;
141
- Event.findElement(evt, 'tr').getElementsBySelector('input[type=checkbox]').each(function(element){
142
- checkbox = element;
143
- }.bind(this));
144
- return checkbox;
145
- };
146
- varienGrid.prototype.removeMultiSelectedRow = function(event, rowElement) {
147
- if(this.selectedRowEvents[rowElement.id] != null) {
148
- this.selectedRowEvents[rowElement.id] = null;
149
- }
150
- return false;
151
- }
152
- varienGrid.prototype.rowMouseUp = function(event){
153
- if(this.doMultiSelect) {
154
- enableHighlighting();
155
- this.doMultiSelect = false;
156
- this.multiSelectFunction(this.selectedRowEvents);
157
- }
158
- };
159
- varienGrid.prototype.rowMouseDown = function(event){
160
- if(event.ctrlKey) {
161
- if(['a', 'input', 'select'].indexOf(Event.element(event).tagName.toLowerCase())!==-1) {
162
- return false;
163
- }
164
- disableHighlighting();
165
- this.doMultiSelect = true;
166
- this.selectedRowEvents = {};
167
- // Add the row we just clicked on
168
- var element = Event.findElement(event, 'tr');
169
- this.addMultiSelectedRow(event, element);
170
- Element.addClassName(element, 'multiselect')
171
- }
172
- }
173
- varienGrid.prototype.rowMouseClick = function(event){
174
- if(this.doMultiSelect) {
175
- this.doMultiSelect = false;
176
- return;
177
- }
178
- if(event.ctrlKey) return;
179
-
180
- if(this.rowClickCallback){
181
- try{
182
- this.rowClickCallback(this, event);
183
- }
184
- catch(e){}
185
- }
186
- varienGlobalEvents.fireEvent('gridRowClick', event);
187
- };
188
- // Multiselect
189
- varienGrid.prototype.onMultiSelect = function(events) {
190
- for(rowid in events) {
191
- var multiRowEvent = events[rowid];
192
- var checkbox = multiRowEvent.checkbox;
193
- this.setCheckboxChecked(checkbox, checkbox.checked ? false : true);
194
- multiRowEvent.rowElement.blur();
195
- Element.removeClassName(multiRowEvent.rowElement, 'multiselect');
196
- }
197
- }
198
-
199
-
200
- varienGridMassaction.prototype.initialize = function (containerId, grid, checkedValues, formFieldNameInternal, formFieldName) {
201
- // MAGE -- begin
202
- this.setOldCallback('row_click', grid.rowClickCallback);
203
- this.setOldCallback('init', grid.initCallback);
204
- this.setOldCallback('init_row', grid.initRowCallback);
205
- this.setOldCallback('pre_init', grid.preInitCallback);
206
-
207
- this.useAjax = false;
208
- this.grid = grid;
209
- this.containerId = containerId;
210
- this.initMassactionElements();
211
-
212
- this.checkedString = checkedValues;
213
- this.formFieldName = formFieldName;
214
- this.formFieldNameInternal = formFieldNameInternal;
215
-
216
- this.grid.initCallback = this.onGridInit.bind(this);
217
- this.grid.preInitCallback = this.onGridPreInit.bind(this);
218
- this.grid.initRowCallback = this.onGridRowInit.bind(this);
219
- this.grid.rowClickCallback = this.onGridRowClick.bind(this);
220
- this.initCheckboxes();
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;
232
-
233
- if(checkedValues != "") {
234
- checkedValues.each(function(item){
235
- this.checkedValues[item] = item;
236
- }.bind(this));
237
- }
238
- };
239
- // Multiselect
240
- varienGridMassaction.prototype.onMultiSelect = function(events) {
241
- this.grid.onMultiSelect(events);
242
- var checkValues = new Array();
243
- var uncheckValues = new Array();
244
- for(rowid in events) {
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() {
264
- var item = this.getSelectedItem();
265
- if(!item) {
266
- this.validator.validate();
267
- return;
268
- }
269
- this.currentItem = item;
270
-
271
- var fieldName = "";
272
- if (item.field == undefined) {
273
- fieldName = this.formFieldName
274
- }
275
- fieldName += '[]';
276
-
277
- var fieldsHtml = '';
278
- var callbackVal = null;
279
- var multiFields = item.fields;
280
-
281
- if(this.currentItem.callback) {
282
- callbackVal = eval(this.currentItem.callback.replace("{checkedValues}", "'"+ this.getCheckedValues()+"'"));
283
- if (callbackVal == null) {
284
- return;
285
- }
286
-
287
- var formCallbackVal = document.createElement('input');
288
- formCallbackVal.type = "hidden";
289
- formCallbackVal.value = callbackVal;
290
- formCallbackVal.name = "callbackval";
291
- this.form.appendChild(formCallbackVal);
292
- }
293
-
294
- if(this.currentItem.confirm && !window.confirm(this.currentItem.confirm)) {
295
- return;
296
- }
297
-
298
- /* Maybe in future
299
- this.getOnlyExistsCheckedValues().each(function(item){
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});
315
- }
316
- } else {
317
- fieldsHtml += this.fieldTemplate.evaluate({name: fieldName, value: item});
318
- }
319
- }.bind(this));
320
- this.formHiddens.update(fieldsHtml);
321
-
322
- // ENHANCED GRID END (MAGE BEGIN)
323
- if(!this.validator.validate()) {
324
- return;
325
- }
326
-
327
-
328
- if(this.useAjax && item.url) {
329
- new Ajax.Request(item.url, {
330
- 'method': 'post',
331
- 'parameters': this.form.serialize(true),
332
- 'onComplete': this.onMassactionComplete.bind(this)
333
- });
334
- } else if(item.url) {
335
- this.form.action = item.url;
336
- this.form.submit();
337
- }
338
- };
339
- varienGridMassaction.prototype.walkSelectedRows = function(walkFunction, warningLimit) {
340
- if(warningLimit == undefined) warningLimit = 100;
341
- var selectedRowCount = 0;
342
- var abort = false;
343
- this.grid.rows.each(function(ie) {
344
- var rcheckboxs = ie.getElementsBySelector('input[type=checkbox]').each(function(chk) {
345
- if(chk.checked) {
346
- if(abort) return;
347
- walkFunction(ie); //user function
348
-
349
- // checks for abort.
350
- selectedRowCount++;
351
- if(selectedRowCount == warningLimit) {
352
- if(!window.confirm("There are over 100 rows processing, should the script continue?")) {
353
- abort = true;
354
- }
355
- }
356
- }
357
- });
358
- });
359
- }
360
- varienGrid.prototype.doFilter = function(){
361
- var filters = $$('#'+this.containerId+' .filter input', '#'+this.containerId+' .filter select');
362
- var searchQry = $$('#'+this.containerId+' .filter input', '#'+this.containerId+' .filter select');
363
- var elements = [];
364
- for(var i in filters){
365
- if(filters[i].value && filters[i].value.length) elements.push(filters[i]);
366
- }
367
- if (!this.doFilterCallback || (this.doFilterCallback && this.doFilterCallback())) {
368
- if($$('input#enhancedGridSearchQry')[0] != undefined) {
369
- this.addVarToUrl('q', $$('input#enhancedGridSearchQry')[0].value);
370
- }
371
- this.reload(this.addVarToUrl(this.filterVar, encode_base64(Form.serializeElements(elements))));
372
- }
373
- }
374
- varienGrid.prototype.resetFilter = function(){
375
- if($$('input#enhancedGridSearchQry')[0] != undefined) {
376
- this.addVarToUrl('q', '')
377
- }
378
- this.addVarToUrl(this.filterVar, '')
379
- this.reload();
380
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/tbt/enhancedgrid/resources/css/enhancedgrid.css DELETED
@@ -1,2 +0,0 @@
1
-
2
- .grid tr.multiselect, .grid tr.multiselect tr { background:#CCF0F0 !important; }
 
 
package.xml CHANGED
@@ -1,19 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TBT_Enhancedgrid</name>
4
- <version>1.3.2.1</version>
5
  <stability>stable</stability>
6
- <license>OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Improved some of the architecture to make the grid column handlers more expandable in the future.
10
- + Resolved issue with Magento Community Edition 1.6+, 1.3.x and Magento Enterprise/Professional Editions 1.11+</summary>
11
- <description>Enhanced Grid is the most downloaded community-driven extension on Magento Connect with over 15,000 Magento stores world-wide running it. Enhanced Grid makes managing products much easier and more efficient for store administrators.</description>
12
- <notes>Improved some of the architecture to make the grid column handlers more expandable in the future, and resolved issue with Magento Community Edition 1.6+ and Magento Enterprise/Professional Editions 1.11+</notes>
13
- <authors><author><name>Jay</name><user>auto-converted</user><email>contact@wdca.ca</email></author><author><name>Jay</name><user>auto-converted</user><email>nelkaake@wdca.ca</email></author></authors>
14
- <date>2011-10-10</date>
15
- <time>20:05:07</time>
16
- <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="449dec037392f3910b9269a24b99e24a"/><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="78c9b49ca889805299c9a7e3a369aa6b"/><dir name="Grid"><file name="Columns.php" hash="f84214fc43f665c79b92dc7a092b364f"/></dir></dir></dir><dir name="System"><file name="Html.php" hash="ae18224ae9a7e450e03ccf22612e3dde"/></dir><dir name="Widget"><file name="Loyalty.php" hash="d1f6919e6bda3e5c201e2b9cd2fb25f1"/><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="298fabe9e68c5693e46ec5e8c9d416cd"/><file name="system.xml" hash="5e18079f506dae5dc6627f41f1d7336c"/></dir><dir name="Helper"><file name="Data.php" hash="236773d2fc20ccc12702af8a41c5fe96"/><file name="Version.php" hash="f90fbcb7beffbe1ac6541f529df9b35b"/></dir><dir name="Model"><dir name="Collection"><dir name="Decorator"><file name="Abstract.php" hash="5358ef85d8ad82fef81e220ab5feec46"/></dir></dir><dir name="Product"><dir name="Collection"><dir name="Category"><file name="Decorator.php" hash="16fff625d09211e054e2caebbdd535ce"/></dir></dir><dir name="Grid"><dir name="Settings"><file name="Columns.php" hash="9acfb2ec990f83a25142a35d0bc37989"/></dir></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="02e45e6d6dd551431bb29be7cfd165f5"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Columns"><file name="Show.php" hash="908fec18c7ce6865c7fb9022dd960b2c"/></dir><dir name="Sort"><file name="Direction.php" hash="23cb37d1af2dd75c3c9537adf90c1bc8"/></dir></dir></dir></dir></dir><dir name="sql"><dir name="enhancedgrid_setup"><file name="mysql4-install-1.0.0.0.php" hash="360399619e0f058a3ce865ab9fd78827"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
- <dependencies/>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TBT_Enhancedgrid</name>
4
+ <version>1.3.4.1</version>
5
  <stability>stable</stability>
6
+ <license uri="http://www.gnu.org/licenses/gpl-3.0.html"></license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Enhanced admin product grid with images, custom attributes and more.</summary>
10
+ <description>Improves the existing Magento admin product management grid. It adds some useful, customizable features to the admin product management grid including new columns and tools.</description>
11
+ <notes></notes>
12
+ <authors><author><name>Jay El-Kaake (special thanks to evaldas.taroza@ufirstgroup.com to making the composer.json file)</name><user>jay</user><email>jay@sweettoothhq.com</email></author></authors>
13
+ <date>2015-11-16</date>
14
+ <time>21:32:38</time>
15
+ <contents><target name="magecommunity"><dir name="TBT"><dir name="Enhancedgrid"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="Grid"><file name="Columns.php" hash="ce407ff5715c837d02b1aba7975bf512"/></dir><file name="Grid.php" hash="031bab0c15554ea1f7d332f7d35b612d"/></dir><file name="Product.php" hash="8e09794fe183ea3c3aeaa1f35962ce1d"/></dir><dir name="System"><file name="Html.php" hash="562392e86f9af01823bbd70c293fc21a"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Category.php" hash="0527c1d7ebdf57b934f714240ac5709a"/><file name="Image.php" hash="a8f34ac1a6734f351ef3654c48b0ac8e"/></dir><dir name="Renderer"><file name="Action.php" hash="f4986db21849c7413061e2906414fd37"/><file name="Category.php" hash="fe638de59898f21a6e4f60f81a03b050"/><file name="Image.php" hash="04662f3ad0b553c88fed6428e10673ec"/></dir></dir><file name="Column.php" hash="4b32c0942170f7b4028c7210de7da6aa"/></dir><file name="Loyalty.php" hash="4a5a47629312357e4f72d05c9d18793e"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d0c2fb1491c4de5e1fc686f98ca8b632"/><file name="Version.php" hash="6300cd38e05192ca25cc72492f4060ea"/></dir><dir name="Model"><dir name="Collection"><dir name="Decorator"><file name="Abstract.php" hash="6222cd8d27550353ca7da2b5292d3c03"/></dir></dir><dir name="Product"><dir name="Collection"><dir name="Category"><file name="Decorator.php" hash="4fd5bfec3c35664329877e319d4516c5"/></dir></dir><dir name="Grid"><dir name="Settings"><file name="Columns.php" hash="52ab0edb646f9ccfd7ff4627faf28bce"/></dir></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="167d3a637aee53e9ee65cd31ee638b7e"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Columns"><file name="Show.php" hash="b6fa3ef200816786cf03a856986d509a"/></dir><dir name="Sort"><file name="Direction.php" hash="a1e597d932df920bf86a437c5f74de83"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Catalog"><file name="ProductController.php" hash="86f09ac6363767fc6f4a893bdfe1088c"/></dir></dir><dir name="etc"><file name="config.xml" hash="9849994645540b6e7b93ae2bdd721ad9"/><file name="system.xml" hash="2d9d79616916912106a710c9237c0c9c"/></dir><dir name="sql"><dir name="enhancedgrid_setup"><file name="mysql4-install-1.0.0.0.php" hash="491b395307ec3951309a78262336e228"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TBT_Enhancedgrid.xml" hash="0654733936d12ab0c7532fcb5492a2dd"/></dir></target><target name="mage"><dir name="app"><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="9a52b17e99764d9ab8336f5155eabf59"/></dir></dir></dir></dir></dir></dir></target></contents>
 
16
  <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>5.6.13</max></php></required></dependencies>
18
  </package>