00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Report_Review_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('customers_grid');
00041 $this->setDefaultSort('review_cnt');
00042 $this->setDefaultDir('desc');
00043 }
00044
00045 protected function _prepareCollection()
00046 {
00047 $collection = Mage::getResourceModel('reports/review_customer_collection')
00048 ->joinCustomers();
00049
00050 $this->setCollection($collection);
00051
00052 return parent::_prepareCollection();
00053 }
00054
00055 protected function _prepareColumns()
00056 {
00057 $this->addColumn('customer_name', array(
00058 'header' => Mage::helper('reports')->__('Customer Name'),
00059 'index' => 'customer_name',
00060 'default' => Mage::helper('reports')->__('Guest'),
00061 ));
00062
00063 $this->addColumn('review_cnt', array(
00064 'header' => Mage::helper('reports')->__('Number Of Reviews'),
00065 'width' => '40px',
00066 'align' => 'right',
00067 'index' => 'review_cnt'
00068 ));
00069
00070 $this->addColumn('action', array(
00071 'header' => Mage::helper('reports')->__('Action'),
00072 'width' => '100px',
00073 'align' => 'center',
00074 'filter' => false,
00075 'sortable' => false,
00076 'renderer' => 'adminhtml/report_grid_column_renderer_customer'
00077 ));
00078
00079 $this->setFilterVisibility(false);
00080
00081 $this->addExportType('*/*/exportCustomerCsv', Mage::helper('reports')->__('CSV'));
00082 $this->addExportType('*/*/exportCustomerExcel', Mage::helper('reports')->__('Excel'));
00083
00084 return parent::_prepareColumns();
00085 }
00086
00087 public function getRowUrl($row)
00088 {
00089 return $this->getUrl('*/catalog_product_review', array('customerId' => $row->getCustomerId()));
00090 }
00091 }