setId('ekomi_sent_status'); $this->setDefaultSort('ekomi_rating_email_id'); $this->setDefaultDir('desc'); $this->setUseAjax(true); $this->setSaveParametersInSession(true); } protected function _prepareCollection() { // @todo add multi store support $collection = Mage::getModel('ekomimeetsmage/rating_email')->getCollection(); $collection->getSelect() ->joinInner( array('order'=>Mage::getSingleton('core/resource')->getTableName('sales_flat_order')), 'main_table.order_id = order.entity_id' ); $this->setCollection($collection); return parent::_prepareCollection(); } protected function _prepareColumns() { $this->addColumn( 'ekomi_rating_email_id', array('header' => $this->getEkomiHelper()->__('ID'), 'align' => 'center', 'width' => '50px', 'filter' => false, 'sortable' => true, 'index' => 'ekomi_rating_email_id', ) ); $this->addColumn( 'sent_status', array('header' => $this->getEkomiHelper()->__('Send Status'), 'align' => 'left', 'width' => '160px', 'filter_index' => 'sent_status', 'index' => 'sent_status', 'type' => 'text', 'filter' => false, 'sortable' => true, 'frame_callback' => array($this, 'decorateStatus') ) ); $this->addColumn( 'send_out_date', array('header' => $this->getEkomiHelper()->__('Planed send time'), 'align' => 'left', 'width' => '160px', 'index' => 'send_out_date', 'sortable' => true, 'filter' => false, 'frame_callback' => array($this, 'decorateTime') ) ); $this->addColumn( 'sent_date', array('header' => $this->getEkomiHelper()->__('Sent time'), 'align' => 'left', 'width' => '160px', 'index' => 'sent_date', 'sortable' => true, 'filter' => false, 'frame_callback' => array($this, 'decorateTime') ) ); $this->addColumn( 'order_id', array('header' => $this->getEkomiHelper()->__('Order number'), 'align' => 'left', 'width' => '120px', 'index' => 'order_id', 'filter_index' => 'order_id', 'filter' => false, 'sortable' => true, 'frame_callback'=> array($this, 'decorateOrderId') ) ); $this->addColumn( 'firstname', array('header' => $this->getEkomiHelper()->__('Firstname'), 'align' => 'left', 'width' => '120px', 'index' => 'customer_firstname', 'filter_index' => 'customer_firstname', 'sortable' => false, ) ); $this->addColumn( 'lastname', array('header' => $this->getEkomiHelper()->__('Lastname'), 'align' => 'left', 'width' => '120px', 'index' => 'customer_lastname', 'filter_index' => 'customer_lastname', 'sortable' => false, ) ); $this->addColumn( 'email', array('header' => $this->getEkomiHelper()->__('E-Mail'), 'align' => 'left', 'index' => 'customer_email', 'filter_index' => 'customer_email', 'sortable' => false, ) ); $this->addColumn( 'settings', array('header' => $this->getEkomiHelper()->__('Settings'), 'align' => 'left', 'width' => '120px', 'index' => 'settings', 'sortable' => false, 'filter' => false, 'frame_callback'=> array($this, 'decorateOptions') ) ); return parent::_prepareColumns(); } public function decorateRating($value, $row, $column, $isExport) { func_get_args(); $html = ""; $html .= "