Mage_Adminhtml_Block_Customer_Edit_Tab_Orders Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_Edit_Tab_Orders:

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)
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Orders.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 Orders.php.

00038     {
00039         parent::__construct();
00040         $this->setId('customer_orders_grid');
00041         $this->setDefaultSort('created_at', 'desc');
00042         $this->setUseAjax(true);
00043     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Orders.php.

00046     {
00047         //TODO: add full name logic
00048         $collection = Mage::getResourceModel('sales/order_collection')
00049             ->addAttributeToSelect('increment_id')
00050             ->addAttributeToSelect('created_at')
00051             ->addAttributeToSelect('grand_total')
00052             ->addAttributeToSelect('order_currency_code')
00053             ->addAttributeToSelect('store_id')
00054             ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
00055             ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
00056             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
00057             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
00058             ->addExpressionAttributeToSelect('billing_name',
00059                 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})',
00060                 array('billing_firstname', 'billing_lastname'))
00061             ->addExpressionAttributeToSelect('shipping_name',
00062                 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
00063                 array('shipping_firstname', 'shipping_lastname'))
00064 
00065             ->addAttributeToFilter('customer_id', Mage::registry('current_customer')->getEntityId())
00066         ;
00067         $this->setCollection($collection);
00068         return parent::_prepareCollection();
00069     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 71 of file Orders.php.

00072     {
00073         $this->addColumn('increment_id', array(
00074             'header'    => Mage::helper('customer')->__('Order #'),
00075             'width'     => '100',
00076             'index'     => 'increment_id',
00077         ));
00078 
00079         $this->addColumn('created_at', array(
00080             'header'    => Mage::helper('customer')->__('Purchase On'),
00081             'index'     => 'created_at',
00082             'type'      => 'datetime',
00083         ));
00084 
00085         /*$this->addColumn('shipping_firstname', array(
00086             'header'    => Mage::helper('customer')->__('Shipped to First Name'),
00087             'index'     => 'shipping_firstname',
00088         ));
00089 
00090         $this->addColumn('shipping_lastname', array(
00091             'header'    => Mage::helper('customer')->__('Shipped to Last Name'),
00092             'index'     => 'shipping_lastname',
00093         ));*/
00094         $this->addColumn('billing_name', array(
00095             'header'    => Mage::helper('customer')->__('Bill to Name'),
00096             'index'     => 'billing_name',
00097         ));
00098 
00099         $this->addColumn('shipping_name', array(
00100             'header'    => Mage::helper('customer')->__('Shipped to Name'),
00101             'index'     => 'shipping_name',
00102         ));
00103 
00104         $this->addColumn('grand_total', array(
00105             'header'    => Mage::helper('customer')->__('Order Total'),
00106             'index'     => 'grand_total',
00107             'type'      => 'currency',
00108             'currency'  => 'order_currency_code',
00109         ));
00110 
00111         if (!Mage::app()->isSingleStoreMode()) {
00112             $this->addColumn('store_id', array(
00113                 'header'    => Mage::helper('customer')->__('Bought From'),
00114                 'index'     => 'store_id',
00115                 'type'      => 'store',
00116                 'store_view' => true
00117             ));
00118         }
00119 
00120         $this->addColumn('action', array(
00121             'header'    => ' ',
00122             'filter'    => false,
00123             'sortable'  => false,
00124             'width'     => '100px',
00125             'renderer'  => 'adminhtml/sales_reorder_renderer_action'
00126         ));
00127 
00128         return parent::_prepareColumns();
00129     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 136 of file Orders.php.

00137     {
00138         return $this->getUrl('*/*/orders', array('_current' => true));
00139     }

getRowUrl ( row  ) 

Definition at line 131 of file Orders.php.

00132     {
00133         return $this->getUrl('*/sales_order/view', array('order_id' => $row->getId()));
00134     }


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

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