Example #1
0
 /**
  * Delete a status history
  */
 public function deletestatushistoryAction()
 {
     $id = $this->getRequest()->getParam('id');
     try {
         if (is_numeric($id)) {
             $record = StatusHistory::getAllInfo($id);
             // get the order information before to delete the status history
             if ($record) {
                 $statusHistory = $record->toArray();
                 $record->delete();
                 $this->_helper->redirector('edit', 'orders', 'admin', array('id' => $statusHistory[0]['order_id'], 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
             }
         }
     } catch (Exception $e) {
         die($e->getMessage() . " " . $e->getTraceAsString());
     }
     $this->_helper->redirector('index', 'orders');
 }