Mage_Adminhtml_Block_Tag_Grid_Customers Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tag_Grid_Customers:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _addColumnFilterToCollection ($column)


Detailed Description

Definition at line 34 of file Customers.php.


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 133 of file Customers.php.

00134     {
00135         if ($this->getCollection() && $column->getFilter()->getValue()) {
00136             $this->getCollection()->addAttributeToFilter($column->getIndex(), $column->getFilter()->getCondition());
00137         }
00138         return $this;
00139     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 36 of file Customers.php.

00037     {
00038         //TODO: add full name logic
00039         $collection = Mage::getResourceModel('tag_customer/collection')
00040             ->addAttributeToSelect('firstname')
00041             ->addAttributeToSelect('lastname')
00042 //            ->addAttributeToSelect('email')
00043 //            ->addAttributeToSelect('created_at')
00044 //            ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing')
00045 //            ->joinAttribute('billing_city', 'customer_address/city', 'default_billing')
00046 //            ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing')
00047 //            ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing')
00048 //            ->joinField('billing_country_name', 'directory/country_name', 'name', 'country_id=billing_country_id', array('language_code'=>'en'))
00049         ;
00050 
00051         if ($productId = $this->getRequest()->getParam('product_id')) {
00052             $collection->addProductFilter($productId);
00053         }
00054         if ($tagId = $this->getRequest()->getParam('tag_id')) {
00055             $collection->addTagFilter($tagId);
00056         }
00057 
00058         $this->setCollection($collection);
00059 
00060         return parent::_prepareCollection();
00061     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 63 of file Customers.php.

00064     {
00065         $this->addColumn('entity_id', array(
00066             'header'    =>Mage::helper('tag')->__('ID'),
00067             'width'     => '40px',
00068             'align'     =>'center',
00069             'sortable'  =>true,
00070             'index'     =>'entity_id'
00071         ));
00072         $this->addColumn('firstname', array(
00073             'header'    =>Mage::helper('tag')->__('First Name'),
00074             'index'     =>'firstname'
00075         ));
00076         $this->addColumn('lastname', array(
00077             'header'    =>Mage::helper('tag')->__('Last Name'),
00078             'index'     =>'lastname'
00079         ));
00080 //        $this->addColumn('email', array(
00081 //            'header'    =>Mage::helper('tag')->__('Email'),
00082 //            'align'     =>'center',
00083 //            'index'     =>'email'
00084 //        ));
00085 //        $this->addColumn('Telephone', array(
00086 //            'header'    =>Mage::helper('tag')->__('Telephone'),
00087 //            'align'     =>'center',
00088 //            'index'     =>'billing_telephone'
00089 //        ));
00090 //        $this->addColumn('billing_postcode', array(
00091 //            'header'    =>Mage::helper('tag')->__('ZIP/Post Code'),
00092 //            'index'     =>'billing_postcode',
00093 //        ));
00094 //        $this->addColumn('billing_country_name', array(
00095 //            'header'    =>Mage::helper('tag')->__('Country'),
00096 //            #'filter'    => 'adminhtml/customer_grid_filter_country',
00097 //            'index'     =>'billing_country_name',
00098 //        ));
00099 //        $this->addColumn('customer_since', array(
00100 //            'header'    =>Mage::helper('tag')->__('Customer Since'),
00101 //            'type'      => 'date',
00102 //            'align'     => 'center',
00103 //            #'format'    => 'Y.m.d',
00104 //            'index'     =>'created_at',
00105 //        ));
00106         $this->addColumn('tags', array(
00107             'header'    => Mage::helper('tag')->__('Tags'),
00108             'index'     => 'tags',
00109             'sortable'  => false,
00110             'filter'    => false,
00111             'renderer'  => 'adminhtml/tag_grid_column_renderer_tags'
00112         ));
00113         $this->addColumn('action', array(
00114             'header'    =>Mage::helper('tag')->__('Action'),
00115             'align'     =>'center',
00116             'width'     => '120px',
00117             'format'    =>'<a href="'.$this->getUrl('*/*/products/customer_id/$entity_id').'">'.Mage::helper('tag')->__('View Products').'</a>',
00118             'filter'    =>false,
00119             'sortable'  =>false,
00120             'is_system' =>true
00121         ));
00122 
00123         $this->setColumnFilter('entity_id')
00124             ->setColumnFilter('email')
00125             ->setColumnFilter('firstname')
00126             ->setColumnFilter('lastname');
00127 
00128 //        $this->addExportType('*/*/exportCsv', Mage::helper('tag')->__('CSV'));
00129 //        $this->addExportType('*/*/exportXml', Mage::helper('tag')->__('XML'));
00130         return parent::_prepareColumns();
00131     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:05 2009 for Magento by  doxygen 1.5.8