*/ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Order_CreateController { /** * Start edit order initialization */ public function startAction() { $this->_getSession()->clear(); $orderId = $this->getRequest()->getParam('order_id'); $order = Mage::getModel('sales/order')->load($orderId); try { if ($order->getId()) { $this->_getSession()->setUseOldShippingMethod(true); $this->_getOrderCreateModel()->initFromOrder($order); $this->_redirect('*/*'); } else { $this->_redirect('*/sales_order/'); } } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addException($e, $e->getMessage()); $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); } } /** * Index page */ public function indexAction() { $this->_title($this->__('Sales'))->_title($this->__('Orders'))->_title($this->__('Edit Order')); $this->loadLayout(); $this->_initSession() ->_setActiveMenu('sales/order') ->renderLayout(); } /** * Acl check for admin * * @return bool */ protected function _isAllowed() { return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/edit'); } }