Skip to content

Commit

Permalink
Merge pull request #1 from reillo/master
Browse files Browse the repository at this point in the history
Add compatibility support for SUPEE-6788
  • Loading branch information
ottonet committed Nov 25, 2015
2 parents 6a1cd21 + 94cfe86 commit 5364692
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Our free extension gives you this functionality.


## CHANGELOG

1.0.6
* Add compatibility support for SUPEE-6788

1.0.5
* add installation and license file
Expand Down
24 changes: 12 additions & 12 deletions htdocs/app/code/community/Mgt/DeleteOrders/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ public function addOptionToSelect($observer)
if ($massBlock) {
$massBlock->addItem('mgt_delete_orders', array(
'label'=> Mage::helper('core')->__('Delete'),
'url' => Mage::getUrl('mgt_delete_orders', array('_secure'=>true)),
'url' => Mage::getUrl('adminhtml/deleteorders_index/index', array('_secure'=>true)),
'confirm' => Mage::helper('core')->__('Are you sure to delete the selected orders?'),
));
}
}
}

public function deleteOrderFromGrid($observer)
{
// This is actually not needed for databases with working foreign keys but some databases are corrupt :(
$order = $observer->getOrder();
if ($order->getId()) {
$coreResource = Mage::getSingleton('core/resource');
$writeConnection = $coreResource->getConnection('core_write');
$salesOrderGridTable = $coreResource->getTableName('sales_flat_order_grid');
$query = sprintf('Delete from %s where entity_id = %s', $salesOrderGridTable, (int)$order->getId());
$writeConnection->raw_query($query);
}
public function deleteOrderFromGrid($observer)
{
// This is actually not needed for databases with working foreign keys but some databases are corrupt :(
$order = $observer->getOrder();
if ($order->getId()) {
$coreResource = Mage::getSingleton('core/resource');
$writeConnection = $coreResource->getConnection('core_write');
$salesOrderGridTable = $coreResource->getTableName('sales_flat_order_grid');
$query = sprintf('Delete from %s where entity_id = %s', $salesOrderGridTable, (int)$order->getId());
$writeConnection->raw_query($query);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';

class Mgt_DeleteOrders_IndexController extends Mage_Adminhtml_Sales_OrderController
class Mgt_DeleteOrders_Adminhtml_Deleteorders_IndexController extends Mage_Adminhtml_Sales_OrderController
{
public function indexAction()
{
Expand Down
12 changes: 6 additions & 6 deletions htdocs/app/code/community/Mgt/DeleteOrders/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Mgt_DeleteOrders>
<version>1.0.5</version>
<version>1.0.6</version>
</Mgt_DeleteOrders>
</modules>
<global>
Expand All @@ -19,13 +19,13 @@
</global>
<admin>
<routers>
<mgt_delete_orders>
<use>admin</use>
<adminhtml>
<args>
<module>Mgt_DeleteOrders</module>
<frontName>mgt_delete_orders</frontName>
<modules>
<Mgt_Base before="Mage_Adminhtml">Mgt_DeleteOrders_Adminhtml</Mgt_Base>
</modules>
</args>
</mgt_delete_orders>
</adminhtml>
</routers>
</admin>
<adminhtml>
Expand Down
2 changes: 1 addition & 1 deletion modman
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
htdocs/app/code/community/Mgt/DeleteOrders/controllers/IndexController.php app/code/community/Mgt/DeleteOrders/controllers/IndexController.php
htdocs/app/code/community/Mgt/DeleteOrders/controllers/Adminhtml/Deleteorders/IndexController.php app/code/community/Mgt/DeleteOrders/controllers/Adminhtml/Deleteorders/IndexController.php
htdocs/app/code/community/Mgt/DeleteOrders/etc/config.xml app/code/community/Mgt/DeleteOrders/etc/config.xml
htdocs/app/code/community/Mgt/DeleteOrders/Helper/Data.php app/code/community/Mgt/DeleteOrders/Helper/Data.php
htdocs/app/code/community/Mgt/DeleteOrders/Model/Observer.php app/code/community/Mgt/DeleteOrders/Model/Observer.php
Expand Down

0 comments on commit 5364692

Please sign in to comment.