Public Member Functions | |
__construct () | |
getOrder () | |
getRowUrl ($row) | |
getGridUrl () | |
getTabLabel () | |
getTabTitle () | |
canShowTab () | |
isHidden () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Shipments.php.
__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 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
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 | ( | ) |
getOrder | ( | ) |
Retrieve order model instance
Definition at line 95 of file Shipments.php.
00096 { 00097 return Mage::registry('current_order'); 00098 }
getRowUrl | ( | $ | row | ) |
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 | ( | ) |