From 4e8426fd79ace14f969564d21f676dc412f67707 Mon Sep 17 00:00:00 2001 From: abijah Date: Tue, 15 Sep 2009 02:32:56 +0000 Subject: [PATCH] Move the Charge Assessment link to the operations area, and updated the Transaction Destroy link to the admin menu and gave it a reasonable redirect instead of the view not found message (since it's no longer a dev function git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@846 97e9348a-65ac-dc4b-aefc-98561f571b83 --- site/app_controller.php | 8 ++++---- site/controllers/transactions_controller.php | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) 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'];