setId('clientpointsGrid'); $this->setDefaultSort('customer_id '); $this->setDefaultDir('DESC'); $this->setSaveParametersInSession(true); } protected function _prepareCollection() { $collection = Mage::getResourceModel('rewardpoints/rewardpoints_collection'); $this->setCollection($collection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn('id', array( 'header' => Mage::helper('rewardpoints')->__('id'), 'align' =>'right', 'width' => '50px', 'index' => 'rewardpoints_account_id', )); $this->addColumn('client_id', array( 'header' => Mage::helper('rewardpoints')->__('Client'), 'align' =>'right', 'index' => 'customer_id', 'width' => '50px', )); $this->addColumn('email', array( 'header' => Mage::helper('rewardpoints')->__('Email'), 'align' =>'right', 'index' => 'email', )); $this->addColumn('order_id', array( 'header' => Mage::helper('rewardpoints')->__('Order ID'), 'align' =>'right', 'index' => 'order_id', )); $this->addColumn('order_id_corres', array( 'header' => Mage::helper('rewardpoints')->__('Type of points'), 'index' => 'order_id', 'width' => '150px', 'type' => 'options', 'options' => array(Rewardpoints_Model_Stats::TYPE_POINTS_ADMIN => Mage::helper('adminhtml')->__('Admin gift'), Rewardpoints_Model_Stats::TYPE_POINTS_REGISTRATION => Mage::helper('adminhtml')->__('Registration points')), )); /* $this->addColumn('email', array( 'header' => Mage::helper('rewardpoints')->__('Customer email'), 'align' => 'left', 'index' => 'email', )); */ $this->addColumn('points_current', array( 'header' => Mage::helper('rewardpoints')->__('Accumulated points'), 'align' => 'right', 'index' => 'points_current', 'width' => '50px', 'filter' => false, )); $this->addColumn('points_spent', array( 'header' => Mage::helper('rewardpoints')->__('Spent points'), 'align' => 'right', 'index' => 'points_spent', 'width' => '50px', 'filter' => false, )); return parent::_prepareColumns(); } protected function _prepareMassaction() { $this->setMassactionIdField('rewardpoints_account_id'); $this->getMassactionBlock()->setFormFieldName('rewardpoints_account_ids'); $this->getMassactionBlock()->addItem('delete', array( 'label' => Mage::helper('rewardpoints')->__('Delete  '), 'url' => $this->getUrl('*/*/massDelete'), 'confirm' => Mage::helper('rewardpoints')->__('Are you sure?') )); return $this; } protected function _afterLoadCollection() { $this->getCollection()->walk('afterLoad'); parent::_afterLoadCollection(); } }