diff --git a/site/app_controller.php b/site/app_controller.php index 393f771..5775c93 100644 --- a/site/app_controller.php +++ b/site/app_controller.php @@ -220,10 +220,6 @@ class AppController extends Controller { $this->addSideMenuLink('Stmt Entries', array('controller' => 'statement_entries', 'action' => 'index'), null, 'SITE', $this->admin_area); - $this->addSideMenuLink('Assess Charges', - array('controller' => 'leases', 'action' => 'assess_all'), null, - 'SITE', $this->admin_area); - $this->addSideMenuLink('Un-Nuke', '#', array('htmlAttributes' => @@ -250,6 +246,10 @@ class AppController extends Controller { $this->addSideMenuLink('New Deposit', array('controller' => 'tenders', 'action' => 'deposit'), null, 'SITE', $this->op_area); + if (!empty($this->params['admin'])) + $this->addSideMenuLink('Assess Charges', + array('controller' => 'leases', 'action' => 'assess_all'), null, + 'SITE', $this->op_area); $url_components = array('plugin', 'controller', 'action', 'named'); if (devbox()) { diff --git a/site/controllers/transactions_controller.php b/site/controllers/transactions_controller.php index c13be0a..b14341d 100644 --- a/site/controllers/transactions_controller.php +++ b/site/controllers/transactions_controller.php @@ -393,9 +393,11 @@ class TransactionsController extends AppController { * irreversibly destroys the data. It is not for normal use. */ - function destroy($id = null) { + function destroy($id) { + $this->Transaction->id = $id; + $customer_id = $this->Transaction->field('customer_id'); $this->Transaction->destroy($id); - //$this->redirect(array('action' => 'index')); + $this->redirect(array('controller' => 'customers', 'action' => 'view', $customer_id)); } @@ -439,7 +441,7 @@ class TransactionsController extends AppController { "This may leave the database in an unstable state." . " Do NOT do this unless you know what you're doing." . " Proceed anyway?"), - 'ACTION', $this->dev_area); + 'ACTION', $this->admin_area); // OK, prepare to render. $title = 'Transaction #' . $transaction['Transaction']['id'];