Mage_Adminhtml_Block_Sales_Order_Shipment_View Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Shipment_View:

Mage_Adminhtml_Block_Widget_Form_Container Mage_Adminhtml_Block_Widget_Container Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getShipment ()
 getHeaderText ()
 getBackUrl ()
 getEmailUrl ()
 getPrintUrl ()
 updateBackButtonUrl ($flag)


Detailed Description

Definition at line 34 of file View.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 Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 37 of file View.php.

00038     {
00039         $this->_objectId    = 'shipment_id';
00040         $this->_controller  = 'sales_order_shipment';
00041         $this->_mode        = 'view';
00042 
00043         parent::__construct();
00044 
00045         $this->_removeButton('reset');
00046         $this->_removeButton('delete');
00047         $this->_updateButton('save', 'label', Mage::helper('sales')->__('Send Tracking Information'));
00048         $this->_updateButton('save', 'onclick', "setLocation('".$this->getEmailUrl()."')");
00049         
00050         if ($this->getShipment()->getId()) {
00051             $this->_addButton('print', array(
00052                 'label'     => Mage::helper('sales')->__('Print'),
00053                 'class'     => 'save',
00054                 'onclick'   => 'setLocation(\''.$this->getPrintUrl().'\')'
00055                 )
00056             );
00057         }
00058     }


Member Function Documentation

getBackUrl (  ) 

Get URL for back (reset) button

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 83 of file View.php.

00084     {
00085         return $this->getUrl(
00086             '*/sales_order/view',
00087             array(
00088                 'order_id'  => $this->getShipment()->getOrderId(),
00089                 'active_tab'=> 'order_shipments'
00090             ));
00091     }

getEmailUrl (  ) 

Definition at line 93 of file View.php.

00094     {
00095         return $this->getUrl('*/sales_order_shipment/email', array('shipment_id'  => $this->getShipment()->getId()));
00096     }

getHeaderText (  ) 

Get header text

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Definition at line 70 of file View.php.

00071     {
00072         if ($this->getShipment()->getEmailSent()) {
00073             $emailSent = Mage::helper('sales')->__('Shipment email sent');
00074         }
00075         else {
00076             $emailSent = Mage::helper('sales')->__('Shipment email not sent');
00077         }
00078 
00079         $header = Mage::helper('sales')->__('Shipment #%s (%s)', $this->getShipment()->getIncrementId(), $emailSent);
00080         return $header;
00081     }

getPrintUrl (  ) 

Definition at line 98 of file View.php.

00099     {
00100         return $this->getUrl('*/*/print', array(
00101             'invoice_id' => $this->getShipment()->getId()
00102         ));
00103     }

getShipment (  ) 

Retrieve shipment model instance

Returns:
Mage_Sales_Model_Order_Shipment

Definition at line 65 of file View.php.

00066     {
00067         return Mage::registry('current_shipment');
00068     }

updateBackButtonUrl ( flag  ) 

Definition at line 105 of file View.php.

00106     {
00107         if ($flag) {
00108             return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/sales_shipment/') . '\')');
00109         }
00110         return $this;
00111     }


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

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