Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid:

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.

Public Member Functions

 __construct ()
 getRowUrl ($row)
 getRowClickCallback ()

Protected Member Functions

 _prepareCollection ()
 _addColumnFilterToCollection ($column)
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('gridAbandoned');
00041     }


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 73 of file Grid.php.

00074     {
00075         $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
00076         $skip = array('subtotal', 'customer_name', 'email'/*, 'created_at', 'updated_at'*/);
00077 
00078         if (in_array($field, $skip)) {
00079             return $this;
00080         }
00081 
00082         parent::_addColumnFilterToCollection($column);
00083         return $this;
00084     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 43 of file Grid.php.

00044     {
00045         if ($this->getRequest()->getParam('website')) {
00046             $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
00047         } else if ($this->getRequest()->getParam('group')) {
00048             $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
00049         } else if ($this->getRequest()->getParam('store')) {
00050             $storeIds = array((int)$this->getRequest()->getParam('store'));
00051         } else {
00052             $storeIds = '';
00053         }
00054 
00055         $collection = Mage::getResourceModel('reports/quote_collection');
00056 
00057         $filter = $this->getParam($this->getVarNameFilter(), array());
00058         if ($filter) {
00059             $filter = base64_decode($filter);
00060             parse_str(urldecode($filter), $data);
00061         }
00062 
00063         if (!empty($data)) {
00064             $collection->prepareForAbandonedReport($storeIds, $data);
00065         } else {
00066             $collection->prepareForAbandonedReport($storeIds);
00067         }
00068 
00069         $this->setCollection($collection);
00070         return parent::_prepareCollection();
00071     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 86 of file Grid.php.

00087     {
00088         $this->addColumn('customer_name', array(
00089             'header'    =>Mage::helper('reports')->__('Customer Name'),
00090             'index'     =>'customer_name',
00091             'sortable'  =>false
00092         ));
00093 
00094         $this->addColumn('email', array(
00095             'header'    =>Mage::helper('reports')->__('Email'),
00096             'index'     =>'email',
00097             'sortable'  =>false
00098         ));
00099 
00100         $this->addColumn('items_count', array(
00101             'header'    =>Mage::helper('reports')->__('Number of Items'),
00102             'width'     =>'80px',
00103             'align'     =>'right',
00104             'index'     =>'items_count',
00105             'sortable'  =>false,
00106             'type'      =>'number'
00107         ));
00108 
00109         $this->addColumn('items_qty', array(
00110             'header'    =>Mage::helper('reports')->__('Quantity of Items'),
00111             'width'     =>'80px',
00112             'align'     =>'right',
00113             'index'     =>'items_qty',
00114             'sortable'  =>false,
00115             'type'      =>'number'
00116         ));
00117 
00118         $this->addColumn('subtotal', array(
00119             'header'    =>Mage::helper('reports')->__('Subtotal'),
00120             'width'     =>'80px',
00121             'type'      =>'currency',
00122             'currency_code' => $this->getCurrentCurrencyCode(),
00123             'index'     =>'subtotal',
00124             'sortable'  =>false,
00125             'renderer'  =>'adminhtml/report_grid_column_renderer_currency'
00126         ));
00127 
00128         $this->addColumn('coupon_code', array(
00129             'header'    =>Mage::helper('reports')->__('Applied Coupon'),
00130             'width'     =>'80px',
00131             'index'     =>'coupon_code',
00132             'sortable'  =>false
00133         ));
00134 
00135         $this->addColumn('created_at', array(
00136             'header'    =>Mage::helper('reports')->__('Created at'),
00137             'width'     =>'170px',
00138             'type'      =>'datetime',
00139             'index'     =>'created_at',
00140             'filter_index'=>'main_table.created_at',
00141             'sortable'  =>false
00142         ));
00143 
00144         $this->addColumn('updated_at', array(
00145             'header'    =>Mage::helper('reports')->__('Updated at'),
00146             'width'     =>'170px',
00147             'type'      =>'datetime',
00148             'index'     =>'updated_at',
00149             'filter_index'=>'main_table.updated_at',
00150             'sortable'  =>false
00151         ));
00152 
00153         $this->addExportType('*/*/exportAbandonedCsv', Mage::helper('reports')->__('CSV'));
00154         $this->addExportType('*/*/exportAbandonedExcel', Mage::helper('reports')->__('Excel'));
00155 
00156         return parent::_prepareColumns();
00157     }

getRowClickCallback (  ) 

Definition at line 164 of file Grid.php.

00164                                          {
00165         return "function(grid, evt) {
00166             var trElement = Event.findElement(evt, 'tr');
00167             if(trElement && trElement.id != ''){
00168                 var newWindow = window.open(trElement.id, '_blank');
00169                 newWindow.focus();
00170             }}";
00171     }

getRowUrl ( row  ) 

Definition at line 159 of file Grid.php.

00160     {
00161         return $this->getUrl('*/customer/edit', array('id'=>$row->getCustomerId(), 'active_tab'=>'cart'));
00162     }


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

Generated on Sat Jul 4 17:22:57 2009 for Magento by  doxygen 1.5.8