1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Sales_Transactions_Detail extends Mage_Adminhtml_Block_Widget_Container
35: {
36: 37: 38: 39: 40:
41: protected $_txn;
42:
43: 44: 45: 46:
47: public function __construct()
48: {
49: parent::__construct();
50:
51: $this->_txn = Mage::registry('current_transaction');
52:
53: $backUrl = ($this->_txn->getOrderUrl()) ? $this->_txn->getOrderUrl() : $this->getUrl('*/*/');
54: $this->_addButton('back', array(
55: 'label' => Mage::helper('sales')->__('Back'),
56: 'onclick' => "setLocation('{$backUrl}')",
57: 'class' => 'back'
58: ));
59:
60: if (Mage::getSingleton('admin/session')->isAllowed('sales/transactions/fetch')
61: && $this->_txn->getOrderPaymentObject()->getMethodInstance()->canFetchTransactionInfo()) {
62: $fetchUrl = $this->getUrl('*/*/fetch' , array('_current' => true));
63: $this->_addButton('fetch', array(
64: 'label' => Mage::helper('sales')->__('Fetch'),
65: 'onclick' => "setLocation('{$fetchUrl}')",
66: 'class' => 'button'
67: ));
68: }
69: }
70:
71: 72: 73: 74: 75:
76: public function ()
77: {
78: return Mage::helper('sales')->__("Transaction # %s | %s", $this->_txn->getTxnId(), $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true));
79: }
80:
81: protected function _toHtml()
82: {
83: $this->setTxnIdHtml($this->escapeHtml($this->_txn->getTxnId()));
84:
85: $this->setParentTxnIdUrlHtml(
86: $this->escapeHtml($this->getUrl('*/sales_transactions/view', array('txn_id' => $this->_txn->getParentId())))
87: );
88:
89: $this->setParentTxnIdHtml(
90: $this->escapeHtml($this->_txn->getParentTxnId())
91: );
92:
93: $this->setOrderIncrementIdHtml($this->escapeHtml($this->_txn->getOrder()->getIncrementId()));
94:
95: $this->setTxnTypeHtml($this->escapeHtml($this->_txn->getTxnType()));
96:
97: $this->setOrderIdUrlHtml(
98: $this->escapeHtml($this->getUrl('*/sales_order/view', array('order_id' => $this->_txn->getOrderId())))
99: );
100:
101: $this->setIsClosedHtml(
102: ($this->_txn->getIsClosed()) ? Mage::helper('sales')->__('Yes') : Mage::helper('sales')->__('No')
103: );
104:
105: $createdAt = (strtotime($this->_txn->getCreatedAt()))
106: ? $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true)
107: : $this->__('N/A');
108: $this->setCreatedAtHtml($this->escapeHtml($createdAt));
109:
110: return parent::_toHtml();
111: }
112: }
113: