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_Customer_Group_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('customerGroupGrid');
00041 $this->setDefaultSort('type');
00042 $this->setDefaultDir('asc');
00043 }
00044
00045
00046
00047
00048
00049 protected function _prepareCollection()
00050 {
00051 $collection = Mage::getResourceModel('customer/group_collection')
00052 ->addTaxClass();
00053
00054 $this->setCollection($collection);
00055 return parent::_prepareCollection();
00056 }
00057
00058
00059
00060
00061 protected function _prepareColumns()
00062 {
00063 $this->addColumn('time', array(
00064 'header' => Mage::helper('customer')->__('ID'),
00065 'width' => '50px',
00066 'align' => 'right',
00067 'index' => 'customer_group_id',
00068 ));
00069
00070 $this->addColumn('type', array(
00071 'header' => Mage::helper('customer')->__('Group Name'),
00072 'index' => 'customer_group_code',
00073 ));
00074
00075 $this->addColumn('class_name', array(
00076 'header' => Mage::helper('customer')->__('Tax Class'),
00077 'index' => 'class_name',
00078 'width' => '200px'
00079 ));
00080
00081 return parent::_prepareColumns();
00082 }
00083
00084 public function getRowUrl($row)
00085 {
00086 return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
00087 }
00088
00089 }