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_Edit_Tab_Tags extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('ordersGrid');
00041 $this->setUseAjax(true);
00042 }
00043
00044 protected function _prepareCollection()
00045 {
00046 $collection = Mage::getResourceModel('customer/customer_collection')
00047 ->addNameToSelect()
00048 ->addAttributeToSelect('email')
00049 ->addAttributeToSelect('created_at')
00050 ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing')
00051 ->joinAttribute('billing_city', 'customer_address/city', 'default_billing')
00052 ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing')
00053 ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing');
00054
00055 $this->setCollection($collection);
00056
00057 return parent::_prepareCollection();
00058 }
00059
00060 protected function _prepareColumns()
00061 {
00062 $this->addColumn('entity_id', array(
00063 'header' => Mage::helper('customer')->__('ID'),
00064 'width' =>5,
00065 'align' =>'center',
00066 'sortable' =>true,
00067 'index' =>'entity_id'
00068 ));
00069 $this->addColumn('name', array(
00070 'header' => Mage::helper('customer')->__('Name'),
00071 'index' =>'name'
00072 ));
00073 $this->addColumn('email', array(
00074 'header' => Mage::helper('customer')->__('Email'),
00075 'width' =>40,
00076 'align' =>'center',
00077 'index' =>'email'
00078 ));
00079 $this->addColumn('telephone', array(
00080 'header' => Mage::helper('customer')->__('Telephone'),
00081 'align' =>'center',
00082 'index' =>'billing_telephone'
00083 ));
00084 $this->addColumn('billing_postcode', array(
00085 'header' => Mage::helper('customer')->__('ZIP/Post Code'),
00086 'index' =>'billing_postcode',
00087 ));
00088 $this->addColumn('billing_country_id', array(
00089 'header' => Mage::helper('customer')->__('Country'),
00090 'type' => 'country',
00091 'index' => 'billing_country_id',
00092 ));
00093 $this->addColumn('customer_since', array(
00094 'header' => Mage::helper('customer')->__('Customer Since'),
00095 'type' => 'date',
00096 'format' => 'Y.m.d',
00097 'index' =>'created_at',
00098 ));
00099 $this->addColumn('action', array(
00100 'header' => Mage::helper('customer')->__('Action'),
00101 'align' =>'center',
00102 'format' =>'<a href="'.$this->getUrl('*/sales/edit/id/$entity_id').'">'.Mage::helper('customer')->__('Edit').'</a>',
00103 'filter' =>false,
00104 'sortable' =>false,
00105 'is_system' =>true
00106 ));
00107
00108 $this->setColumnFilter('entity_id')
00109 ->setColumnFilter('email')
00110 ->setColumnFilter('name');
00111
00112 $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
00113 $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('XML'));
00114 return parent::_prepareColumns();
00115 }
00116
00117 public function getGridUrl()
00118 {
00119 return $this->getUrl('*/*/index', array('_current'=>true));
00120 }
00121
00122 }