Mage_Adminhtml_Block_Sales_Shipment_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Shipment_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)
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _prepareMassaction ()


Detailed Description

Adminhtml sales orders grid

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 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 35 of file Grid.php.

00036     {
00037         parent::__construct();
00038         $this->setId('sales_shipment_grid');
00039         $this->setDefaultSort('created_at');
00040         $this->setDefaultDir('DESC');
00041     }


Member Function Documentation

_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         //TODO: add full name logic
00046         $collection = Mage::getResourceModel('sales/order_shipment_collection')
00047             ->addAttributeToSelect('increment_id')
00048             ->addAttributeToSelect('created_at')
00049             ->addAttributeToSelect('total_qty')
00050             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
00051             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
00052             ->joinAttribute('order_increment_id', 'order/increment_id', 'order_id', null, 'left')
00053             ->joinAttribute('order_created_at', 'order/created_at', 'order_id', null, 'left')
00054         ;
00055         $this->setCollection($collection);
00056         return parent::_prepareCollection();
00057     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 59 of file Grid.php.

00060     {
00061         $this->addColumn('increment_id', array(
00062             'header'    => Mage::helper('sales')->__('Shipment #'),
00063             'index'     => 'increment_id',
00064             'type'      => 'number',
00065         ));
00066 
00067         $this->addColumn('created_at', array(
00068             'header'    => Mage::helper('sales')->__('Date Shipped'),
00069             'index'     => 'created_at',
00070             'type'      => 'datetime',
00071         ));
00072 
00073         $this->addColumn('order_increment_id', array(
00074             'header'    => Mage::helper('sales')->__('Order #'),
00075             'index'     => 'order_increment_id',
00076             'type'      => 'number',
00077         ));
00078 
00079         $this->addColumn('order_created_at', array(
00080             'header'    => Mage::helper('sales')->__('Order Date'),
00081             'index'     => 'order_created_at',
00082             'type'      => 'datetime',
00083         ));
00084 
00085         $this->addColumn('shipping_firstname', array(
00086             'header' => Mage::helper('sales')->__('Ship to First name'),
00087             'index' => 'shipping_firstname',
00088         ));
00089 
00090         $this->addColumn('shipping_lastname', array(
00091             'header' => Mage::helper('sales')->__('Ship to Last name'),
00092             'index' => 'shipping_lastname',
00093         ));
00094 
00095         $this->addColumn('total_qty', array(
00096             'header' => Mage::helper('sales')->__('Total Qty'),
00097             'index' => 'total_qty',
00098             'type'  => 'number',
00099         ));
00100 
00101         $this->addColumn('action',
00102             array(
00103                 'header'    => Mage::helper('sales')->__('Action'),
00104                 'width'     => '50px',
00105                 'type'      => 'action',
00106                 'getter'     => 'getId',
00107                 'actions'   => array(
00108                     array(
00109                         'caption' => Mage::helper('sales')->__('View'),
00110                         'url'     => array('base'=>'*/*/view'),
00111                         'field'   => 'shipment_id'
00112                     )
00113                 ),
00114                 'filter'    => false,
00115                 'sortable'  => false,
00116                 'is_system' => true
00117         ));
00118 
00119         return parent::_prepareColumns();
00120     }

_prepareMassaction (  )  [protected]

Prepare grid massaction actions

Returns:
Mage_Adminhtml_Block_Widget_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 131 of file Grid.php.

00132     {
00133         $this->setMassactionIdField('entity_id');
00134         $this->getMassactionBlock()->setFormFieldName('shipment_ids');
00135 
00136         $this->getMassactionBlock()->addItem('pdfshipments_order', array(
00137              'label'=> Mage::helper('sales')->__('PDF Packingslips'),
00138              'url'  => $this->getUrl('*/*/pdfshipments'),
00139         ));
00140 
00141         return $this;
00142     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 144 of file Grid.php.

00145     {
00146         return $this->getUrl('*/*/*', array('_current' => true));
00147     }

getRowUrl ( row  ) 

Definition at line 122 of file Grid.php.

00123     {
00124         return $this->getUrl('*/*/view',
00125             array(
00126                 'shipment_id'=> $row->getId(),
00127             )
00128         );
00129     }


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

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