Skip to content

Commit 6e79a99

Browse files
committed
d
1 parent 6781606 commit 6e79a99

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class Stackexchange_Magento84352_Block_Adminhtml_Sales_Order_Grid extends
4+
Mage_Adminhtml_Block_Sales_Order_Grid{
5+
6+
7+
protected function _prepareMassaction()
8+
{
9+
parent::_prepareMassaction();
10+
11+
12+
$this->getMassactionBlock()->addItem('sprint_shipping_label', array(
13+
'label'=> Mage::helper('sales')->__('sPrint Shipping Labels'),
14+
'url' => $this->getUrl('*/sales_order_shipment/massPrintShippingLabel'),
15+
));
16+
$this->getMassactionBlock()->removeItem('cancel_order');
17+
return $this;
18+
}
19+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* To change this license header, choose License Headers in Project Properties.
5+
* To change this template file, choose Tools | Templates
6+
* and open the template in the editor.
7+
*/
8+
9+
class Stackexchange_Magento84352_Model_Observer{
10+
public function adminhtmlWidgetContainerHtmlBefore($event)
11+
{
12+
$block = $event->getBlock();
13+
14+
if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
15+
$block->removeButton('order_cancel');
16+
}
17+
}
18+
public function removeButtoncancel($observer)
19+
{
20+
$block = $observer->getEvent()->getBlock();
21+
if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
22+
&& $block->getRequest()->getControllerName() == 'sales_order')
23+
{
24+
25+
echo $block->getCount();
26+
27+
}
28+
}
29+
30+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config>
3+
<modules>
4+
<Stackexchange_Magento84352>
5+
<version>1.0.0</version>
6+
</Stackexchange_Magento84352>
7+
</modules>
8+
<global>
9+
<models>
10+
<magento84352>
11+
<class>Stackexchange_Magento84352_Model</class>
12+
</magento84352>
13+
</models>
14+
<blocks>
15+
<magento84352>
16+
<class>Stackexchange_Magento84352_Block</class>
17+
</magento84352>
18+
<adminhtml>
19+
<rewrite>
20+
<sales_order_grid>Stackexchange_Magento84352_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
21+
</rewrite>
22+
</adminhtml>
23+
</blocks>
24+
25+
</global>
26+
<adminhtml>
27+
<events>
28+
<adminhtml_widget_container_html_before>
29+
<observers>
30+
<your_module>
31+
<class>magento84352/observer</class>
32+
<type>singleton</type>
33+
<method>adminhtmlWidgetContainerHtmlBefore</method>
34+
</your_module>
35+
</observers>
36+
</adminhtml_widget_container_html_before>
37+
</events>
38+
</adminhtml>
39+
<!-- another events may which remove button from grid -->
40+
41+
<adminhtml>
42+
<events>
43+
<core_block_abstract_prepare_layout_before>
44+
<observers>
45+
<remove_cancel_from_grid>
46+
<type>singleton</type>
47+
<class>magento84352/observer</class>
48+
<method>removeButtoncancel</method>
49+
</remove_cancel_from_grid>
50+
</observers>
51+
</core_block_abstract_prepare_layout_before>
52+
</events>
53+
</adminhtml>
54+
</config>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<config>
3+
<modules>
4+
<Stackexchange_Magento84352>
5+
<codePool>community</codePool>
6+
<active>true</active>
7+
</Stackexchange_Magento84352>
8+
</modules>
9+
</config>

0 commit comments

Comments
 (0)