Version Notes
none
Download this release
Release Info
Developer | Magento Core Team |
Extension | Wyomind_OrdersEraser |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
app/code/local/Wyomind/Orderseraser/controllers/Adminhtml/OrderseraserController.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
{
|
3 |
->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
|
4 |
->_addBreadcrumb($this->__('Orders'), $this->__('Orders'))
|
5 |
->renderLayout();
|
6 |
return substr(Mage::getVersion(),0,3);
|
7 |
protected function _initOrder()
|
8 |
-
{
|
9 |
$id = $this->getRequest()->getParam('order_id');
|
10 |
$order = Mage::getModel('sales/order')->load($id);
|
11 |
if (!$order->getId()) {
|
12 |
$this->_getSession()->addError($this->__('This order no longer exists.'));
|
13 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
14 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
15 |
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
16 |
return false;
|
17 |
}
|
18 |
Mage::register('sales_order', $order);
|
19 |
Mage::register('current_order', $order);
|
20 |
return $order;
|
21 |
}
|
22 |
{
|
23 |
|
24 |
$orderIds = $this->getRequest()->getPost('order_ids', array());
|
25 |
$countDeleteOrder = 0;
|
26 |
foreach ($orderIds as $orderId) {
|
27 |
if ( $this->getVersion()<=1.3 && Mage::getModel('orderseraser/orderseraser')->_erase($orderId)) $countDeleteOrder++;
|
28 |
elseif($order->delete()) $countDeleteOrder++;
|
29 |
}
|
30 |
if ($countDeleteOrder>0) {
|
31 |
$this->_getSession()->addSuccess($this->__('%s order(s) successfully deleted', $countDeleteOrder));
|
32 |
}
|
33 |
else {
|
34 |
$this->_getSession()->addError($this->__('Unable to delete orders.'));
|
35 |
}
|
36 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
37 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
38 |
}
|
|
|
39 |
$id = $this->getRequest()->getParam('order_id');
|
40 |
$order = Mage::getModel('sales/order')->load($id);
|
41 |
if (!$order->getId()) {
|
42 |
$this->_getSession()->addError($this->__('This order no longer exists.'));
|
43 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
44 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
45 |
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
46 |
return false;
|
47 |
}
|
48 |
Mage::register('sales_order', $order);
|
49 |
Mage::register('current_order', $order);
|
50 |
return $order;
|
51 |
}
|
52 |
{
|
53 |
|
54 |
$orderIds = $this->getRequest()->getPost('order_ids', array());
|
55 |
$countDeleteOrder = 0;
|
56 |
foreach ($orderIds as $orderId) {
|
57 |
if ( $this->getVersion()<=1.3 && Mage::getModel('orderseraser/orderseraser')->_erase($orderId)) $countDeleteOrder++;
|
58 |
elseif(Mage::getModel('sales/order')->load($orderId)->delete()) $countDeleteOrder++;
|
59 |
}
|
60 |
if ($countDeleteOrder>0) {
|
61 |
$this->_getSession()->addSuccess($this->__('%s order(s) successfully deleted', $countDeleteOrder));
|
62 |
}
|
63 |
else {
|
64 |
$this->_getSession()->addError($this->__('Unable to delete orders.'));
|
65 |
}
|
66 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
67 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
68 |
}
|
69 |
if ($order = $this->_initOrder()) {
|
70 |
try {
|
71 |
|
72 |
if ( $this->getVersion()<=1.3) Mage::getModel('orderseraser/orderseraser')->_erase($order->getId());
|
73 |
$this->__('Order was successfully deleted.')
|
74 |
);
|
75 |
}
|
76 |
catch (Mage_Core_Exception $e) {
|
77 |
$this->_getSession()->addError($e->getMessage());
|
78 |
}
|
79 |
catch (Exception $e) {
|
80 |
$this->_getSession()->addError($this->__('Unable to delete order.'));
|
81 |
}
|
82 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
83 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
84 |
}
|
1 |
<?php
|
2 |
{
|
3 |
->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
|
4 |
->_addBreadcrumb($this->__('Orders'), $this->__('Orders'))
|
5 |
->renderLayout();
|
6 |
return substr(Mage::getVersion(),0,3);
|
7 |
protected function _initOrder()
|
|
|
8 |
$id = $this->getRequest()->getParam('order_id');
|
9 |
$order = Mage::getModel('sales/order')->load($id);
|
10 |
if (!$order->getId()) {
|
11 |
$this->_getSession()->addError($this->__('This order no longer exists.'));
|
12 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
13 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
14 |
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
15 |
return false;
|
16 |
}
|
17 |
Mage::register('sales_order', $order);
|
18 |
Mage::register('current_order', $order);
|
19 |
return $order;
|
20 |
}
|
21 |
{
|
22 |
|
23 |
$orderIds = $this->getRequest()->getPost('order_ids', array());
|
24 |
$countDeleteOrder = 0;
|
25 |
foreach ($orderIds as $orderId) {
|
26 |
if ( $this->getVersion()<=1.3 && Mage::getModel('orderseraser/orderseraser')->_erase($orderId)) $countDeleteOrder++;
|
27 |
elseif($order->delete()) $countDeleteOrder++;
|
28 |
}
|
29 |
if ($countDeleteOrder>0) {
|
30 |
$this->_getSession()->addSuccess($this->__('%s order(s) successfully deleted', $countDeleteOrder));
|
31 |
}
|
32 |
else {
|
33 |
$this->_getSession()->addError($this->__('Unable to delete orders.'));
|
34 |
}
|
35 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
36 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
37 |
}
|
38 |
+
{
|
39 |
$id = $this->getRequest()->getParam('order_id');
|
40 |
$order = Mage::getModel('sales/order')->load($id);
|
41 |
if (!$order->getId()) {
|
42 |
$this->_getSession()->addError($this->__('This order no longer exists.'));
|
43 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
44 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
45 |
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
46 |
return false;
|
47 |
}
|
48 |
Mage::register('sales_order', $order);
|
49 |
Mage::register('current_order', $order);
|
50 |
return $order;
|
51 |
}
|
52 |
{
|
53 |
|
54 |
$orderIds = $this->getRequest()->getPost('order_ids', array());
|
55 |
$countDeleteOrder = 0;
|
56 |
foreach ($orderIds as $orderId) {
|
57 |
if ( $this->getVersion()<=1.3 && Mage::getModel('orderseraser/orderseraser')->_erase($orderId)) $countDeleteOrder++;
|
58 |
elseif(Mage::getModel('sales/order')->load($orderId)->delete()) $countDeleteOrder++;
|
59 |
}
|
60 |
if ($countDeleteOrder>0) {
|
61 |
$this->_getSession()->addSuccess($this->__('%s order(s) successfully deleted', $countDeleteOrder));
|
62 |
}
|
63 |
else {
|
64 |
$this->_getSession()->addError($this->__('Unable to delete orders.'));
|
65 |
}
|
66 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
67 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
68 |
}
|
69 |
if ($order = $this->_initOrder()) {
|
70 |
try {
|
71 |
|
72 |
if ( $this->getVersion()<=1.3) Mage::getModel('orderseraser/orderseraser')->_erase($order->getId());
|
73 |
$this->__('Order was successfully deleted.')
|
74 |
);
|
75 |
}
|
76 |
catch (Mage_Core_Exception $e) {
|
77 |
$this->_getSession()->addError($e->getMessage());
|
78 |
}
|
79 |
catch (Exception $e) {
|
80 |
$this->_getSession()->addError($this->__('Unable to delete order.'));
|
81 |
}
|
82 |
if(!$this->getRequest()->getParam('eraser')) $this->_redirect('adminhtml/sales_order/');
|
83 |
else $this->_redirect('orderseraser/adminhtml_orderseraser');
|
84 |
}
|
app/code/local/Wyomind/Orderseraser/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Wyomind_Orderseraser>
|
6 |
-
<version>2.0.
|
7 |
</Wyomind_Orderseraser>
|
8 |
</modules>
|
9 |
<admin>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Wyomind_Orderseraser>
|
6 |
+
<version>2.0.2</version>
|
7 |
</Wyomind_Orderseraser>
|
8 |
</modules>
|
9 |
<admin>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wyomind_OrdersEraser</name>
|
4 |
-
<version>2.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Orders eraser allows you to clean your sales database by deleting useless orders and linked invoices and/or shipping in once.</description>
|
11 |
<notes>none</notes>
|
12 |
<authors><author><name>Pierre</name><user>auto-converted</user><email>contact@wyomind.com</email></author></authors>
|
13 |
-
<date>2011-03-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Orderseraser.xml" hash="7ecc56d5dd2d7a14ae9e4445efe4fd1e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wyomind_Orderseraser.xml" hash="c8103aabbb8d9961415e6e347ee587dc"/></dir></target><target name="magelocal"><dir name="Wyomind"><dir name="Orderseraser"><dir name="Block"><file name="Orderseraser.php" hash="3c0098cacb0aba9a8a00ca0c0ae4e287"/><dir name="Enhancedgrid"><file name="Grid.php" hash="44caf8975104c93eda3baef4dd671a30"/></dir><dir name="Erasergrid"><file name="Grid.php" hash="2e0998d4532392829bfdf5993f2544b3"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderseraserController.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wyomind_OrdersEraser</name>
|
4 |
+
<version>2.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Orders eraser allows you to clean your sales database by deleting useless orders and linked invoices and/or shipping in once.</description>
|
11 |
<notes>none</notes>
|
12 |
<authors><author><name>Pierre</name><user>auto-converted</user><email>contact@wyomind.com</email></author></authors>
|
13 |
+
<date>2011-03-16</date>
|
14 |
+
<time>10:27:52</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Orderseraser.xml" hash="7ecc56d5dd2d7a14ae9e4445efe4fd1e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wyomind_Orderseraser.xml" hash="c8103aabbb8d9961415e6e347ee587dc"/></dir></target><target name="magelocal"><dir name="Wyomind"><dir name="Orderseraser"><dir name="Block"><file name="Orderseraser.php" hash="3c0098cacb0aba9a8a00ca0c0ae4e287"/><dir name="Enhancedgrid"><file name="Grid.php" hash="44caf8975104c93eda3baef4dd671a30"/></dir><dir name="Erasergrid"><file name="Grid.php" hash="2e0998d4532392829bfdf5993f2544b3"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderseraserController.php" hash="9e97cc33825d5bda5bb0a57eb8ee1797"/></dir></dir><dir name="etc"><file name="config.xml" hash="18f0b1d09c0ff0d29e173cd08b868010"/></dir><dir name="Helper"><file name="Data.php" hash="9f2bab1860e9521a04f8cecf906a7acc"/></dir><dir name="Model"><file name="Orderseraser.php" hash="5ef877a60d98b8cdb6b84df654acea93"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|