1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Sales
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Adminhtml billing agreement related orders tab
29: *
30: * @author Magento Core Team <core@magentocommerce.com>
31: */
32: class Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Orders extends Mage_Adminhtml_Block_Sales_Order_Grid
33: implements Mage_Adminhtml_Block_Widget_Tab_Interface
34: {
35: /**
36: * Initialize grid params
37: *
38: */
39: public function __construct()
40: {
41: parent::__construct();
42: $this->setId('billing_agreement_orders');
43: }
44:
45: /**
46: * Prepare related orders collection
47: *
48: * @return Mage_Adminhtml_Block_Widget_Grid
49: */
50: protected function _prepareCollection()
51: {
52: $collection = Mage::getResourceModel('sales/order_grid_collection');
53: $collection->addBillingAgreementsFilter(Mage::registry('current_billing_agreement')->getId());
54: $this->setCollection($collection);
55: return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
56: }
57:
58: /**
59: * Return Tab label
60: *
61: * @return string
62: */
63: public function getTabLabel()
64: {
65: return $this->__('Related Orders');
66: }
67:
68: /**
69: * Return Tab title
70: *
71: * @return string
72: */
73: public function getTabTitle()
74: {
75: return $this->__('Related Orders');
76: }
77:
78: /**
79: * Can show tab in tabs
80: *
81: * @return boolean
82: */
83: public function canShowTab()
84: {
85: return true;
86: }
87:
88: /**
89: * Tab is hidden
90: *
91: * @return boolean
92: */
93: public function isHidden()
94: {
95: return false;
96: }
97:
98: /**
99: * Retrieve grid url
100: *
101: * @return string
102: */
103: public function getGridUrl()
104: {
105: return $this->getUrl('*/*/ordersGrid', array('_current'=>true));
106: }
107:
108: /**
109: * Remove import/export field from grid
110: *
111: * @return bool
112: */
113: public function getExportTypes()
114: {
115: return false;
116: }
117:
118: /**
119: * Disable massaction in grid
120: *
121: * @return Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Orders
122: */
123: protected function _prepareMassaction()
124: {
125: return $this;
126: }
127: }
128: