1: <?php
2:
3: /**
4: * ShipSync
5: *
6: * @category IllApps
7: * @package IllApps_Shipsync
8: * @copyright Copyright (c) 2014 EcoMATICS, Inc. DBA IllApps (http://www.illapps.com)
9: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10: */
11:
12: /**
13: * IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View
14: */
15: class IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View extends Mage_Adminhtml_Block_Widget_Form_Container
16: {
17:
18: /**
19: * Construct
20: */
21: public function __construct()
22: {
23: $this->_objectId = 'shipment_id';
24: $this->_controller = 'sales_order_shipment_packages';
25: $this->_mode = 'view';
26: $this->_headerText = 'Shipment Package View';
27:
28: parent::__construct();
29:
30: $this->_removeButton('reset');
31: $this->_removeButton('delete');
32: $this->_removeButton('save');
33: }
34:
35: /**
36: * Get Back Url
37: */
38: public function getBackUrl()
39: {
40: return $this->getUrl(
41: 'adminhtml/sales_shipment/view',
42: array(
43: 'shipment_id' => $this->getShipment()->getId()
44: ));
45: }
46:
47: /**
48: * Update Back Button Url
49: */
50: public function updateBackButtonUrl($flag)
51: {
52: if ($flag) {
53: if ($this->getShipment()->getBackUrl()) {
54: return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getShipment()->getBackUrl() . '\')');
55: }
56: return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('adminhtml/sales_shipment/') . '\')');
57: }
58: return $this;
59: }
60:
61: /**
62: * Get Shipment
63: */
64: public function getShipment()
65: {
66: return Mage::registry('current_shipment');
67: }
68: }
69: