public function deleteAction() { $userId = NULL; $auth = Zend_Auth::getInstance(); $authAccount = $auth->getStorage()->read(); if (null != $authAccount) { if (null != $authAccount->getId()) { $userId = $authAccount->getId(); } } $id = $this->getRequest()->getParam('id'); $model = new Default_Model_RecurrentExpenses(); if ($model->find($id)) { if ($expenseId = $model->delete()) { //Needs_Tools::DeleteLegaturi( $expenseId ); $this->_flashMessenger->addMessage("<div class='success canhide'><p>Recurrent expense was deleted successfully!<a href='javascript:;'></a></p></div>"); } else { $this->_flashMessenger->addMessage("<div class='failure canhide'><p>Recurrent expense was not deleted!<a href='javascript:;'></a></p></div>"); } $this->_redirect('recurrent-expenses'); } }