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_View
14: */
15: class IllApps_Shipsync_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
16: {
17:
18: /**
19: * Construct
20: */
21: public function __construct()
22: {
23: parent::__construct();
24:
25: // If package can be shipped
26: if ($this->_isAllowedAction('ship') && $this->getOrder()->canShip())
27: {
28: // Add ship button
29: $this->_addButton('ship_with_shipsync', array(
30: 'label' => Mage::helper('sales')->__('Ship with ShipSync'),
31: 'onclick' => 'setLocation(\'' . $this->getUrl('shipsync') . '\')',
32: ));
33: } else {
34: $message = Mage::helper('sales')->__('Are you sure you want to delete the shipment?');
35: $this->_addButton('delete_shipment', array(
36: 'label' => Mage::helper('sales')->__('Delete Shipment'),
37: 'onclick' => 'deleteConfirm(\''.$message.'\', \'' . $this->getUrl('shipsync/index/delete') . '\')',
38: ));
39: }
40: }
41: }
42: