1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Review_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setRowClickCallback('review.gridRowClick');
41: $this->setUseAjax(true);
42: }
43:
44: protected function _prepareColumns()
45: {
46: $this->addColumn('entity_id', array(
47: 'header' => Mage::helper('review')->__('ID'),
48: 'width' => '50px',
49: 'index' => 'entity_id',
50: ));
51:
52: $this->addColumn('name', array(
53: 'header' => Mage::helper('review')->__('Name'),
54: 'index' => 'name',
55: ));
56:
57: if ((int)$this->getRequest()->getParam('store', 0)) {
58: $this->addColumn('custom_name', array(
59: 'header' => Mage::helper('review')->__('Name in Store'),
60: 'index' => 'custom_name'
61: ));
62: }
63:
64: $this->addColumn('sku', array(
65: 'header' => Mage::helper('review')->__('SKU'),
66: 'width' => '80px',
67: 'index' => 'sku'
68: ));
69:
70: $this->addColumn('price', array(
71: 'header' => Mage::helper('review')->__('Price'),
72: 'type' => 'currency',
73: 'index' => 'price'
74: ));
75:
76: $this->addColumn('qty', array(
77: 'header' => Mage::helper('review')->__('Qty'),
78: 'width' => '130px',
79: 'type' => 'number',
80: 'index' => 'qty'
81: ));
82:
83: $this->addColumn('status', array(
84: 'header' => Mage::helper('review')->__('Status'),
85: 'width' => '90px',
86: 'index' => 'status',
87: 'type' => 'options',
88: 'source' => 'catalog/product_status',
89: 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
90: ));
91:
92: 93: 94:
95: if (!Mage::app()->isSingleStoreMode()) {
96: $this->addColumn('websites',
97: array(
98: 'header'=> Mage::helper('review')->__('Websites'),
99: 'width' => '100px',
100: 'sortable' => false,
101: 'index' => 'websites',
102: 'type' => 'options',
103: 'options' => Mage::getModel('core/website')->getCollection()->toOptionHash(),
104: ));
105: }
106: }
107:
108: public function getGridUrl()
109: {
110: return $this->getUrl('*/*/productGrid', array('_current'=>true));
111: }
112:
113: public function getRowUrl($row)
114: {
115: return $this->getUrl('*/*/jsonProductInfo', array('id' => $row->getId()));
116: }
117:
118: protected function _prepareMassaction()
119: {
120: return $this;
121: }
122: }
123: