Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget_Tab_Interface 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 ()
 getOrder ()
 getRowUrl ($row)
 getGridUrl ()
 getTabLabel ()
 getTabTitle ()
 canShowTab ()
 isHidden ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

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

00039     {
00040         parent::__construct();
00041         $this->setId('order_shipments_grid');
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 Shipments.php.

00046     {
00047         //TODO: add full name logic
00048         $collection = Mage::getResourceModel('sales/order_shipment_collection')
00049             ->addAttributeToSelect('increment_id')
00050             ->addAttributeToSelect('created_at')
00051             ->addAttributeToSelect('total_qty')
00052             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
00053             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
00054             ->addExpressionAttributeToSelect('shipping_name',
00055                 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
00056                 array('shipping_firstname', 'shipping_lastname'))
00057             ->setOrderFilter($this->getOrder())
00058         ;
00059         $this->setCollection($collection);
00060         return parent::_prepareCollection();
00061     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 63 of file Shipments.php.

00064     {
00065         $this->addColumn('increment_id', array(
00066             'header' => Mage::helper('sales')->__('Shipment #'),
00067             'index' => 'increment_id',
00068         ));
00069 
00070         $this->addColumn('shipping_name', array(
00071             'header' => Mage::helper('sales')->__('Ship to Name'),
00072             'index' => 'shipping_name',
00073         ));
00074 
00075         $this->addColumn('created_at', array(
00076             'header' => Mage::helper('sales')->__('Date Shipped'),
00077             'index' => 'created_at',
00078             'type' => 'datetime',
00079         ));
00080 
00081         $this->addColumn('total_qty', array(
00082             'header' => Mage::helper('sales')->__('Total Qty'),
00083             'index' => 'total_qty',
00084             'type'  => 'number',
00085         ));
00086 
00087         return parent::_prepareColumns();
00088     }

canShowTab (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 128 of file Shipments.php.

00129     {
00130         if ($this->getOrder()->getIsVirtual()) {
00131             return false;
00132         }
00133         return true;
00134     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 110 of file Shipments.php.

00111     {
00112         return $this->getUrl('*/*/shipments', array('_current' => true));
00113     }

getOrder (  ) 

Retrieve order model instance

Returns:
Mage_Sales_Model_Order

Definition at line 95 of file Shipments.php.

00096     {
00097         return Mage::registry('current_order');
00098     }

getRowUrl ( row  ) 

Definition at line 100 of file Shipments.php.

00101     {
00102         return $this->getUrl(
00103             '*/sales_order_shipment/view',
00104             array(
00105                 'shipment_id'=> $row->getId(),
00106                 'order_id'  => $row->getOrderId()
00107              ));
00108     }

getTabLabel (  ) 

######################## TAB settings #################################

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 118 of file Shipments.php.

00119     {
00120         return Mage::helper('sales')->__('Shipments');
00121     }

getTabTitle (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 123 of file Shipments.php.

00124     {
00125         return Mage::helper('sales')->__('Order Shipments');
00126     }

isHidden (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 136 of file Shipments.php.

00137     {
00138         return false;
00139     }


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