00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Sales_Order_Shipment_View extends Mage_Adminhtml_Block_Widget_Form_Container
00035 {
00036
00037 public function __construct()
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 }
00059
00060
00061
00062
00063
00064
00065 public function getShipment()
00066 {
00067 return Mage::registry('current_shipment');
00068 }
00069
00070 public function getHeaderText()
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 }
00082
00083 public function getBackUrl()
00084 {
00085 return $this->getUrl(
00086 '*/sales_order/view',
00087 array(
00088 'order_id' => $this->getShipment()->getOrderId(),
00089 'active_tab'=> 'order_shipments'
00090 ));
00091 }
00092
00093 public function getEmailUrl()
00094 {
00095 return $this->getUrl('*/sales_order_shipment/email', array('shipment_id' => $this->getShipment()->getId()));
00096 }
00097
00098 public function getPrintUrl()
00099 {
00100 return $this->getUrl('*
00101
00102
00103
00104
00105
00106
00107
00108 sales_shipment/') . '\')');
00109 }
00110 return $this;
00111 }
00112 }