Added automated disabling of admin and development menu items (at least the ones that are explicitly added to those sections of the menu).
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@765 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -213,44 +213,39 @@ class AppController extends Controller {
|
|||||||
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
|
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
|
||||||
/* 'SITE', $this->op_area); */
|
/* 'SITE', $this->op_area); */
|
||||||
|
|
||||||
if ($this->params['admin']) {
|
$this->addSideMenuLink('Accounts',
|
||||||
$this->addSideMenuLink('Accounts',
|
array('controller' => 'accounts', 'action' => 'index'), null,
|
||||||
array('controller' => 'accounts', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Contacts',
|
||||||
$this->addSideMenuLink('Contacts',
|
array('controller' => 'contacts', 'action' => 'index'), null,
|
||||||
array('controller' => 'contacts', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Ledgers',
|
||||||
$this->addSideMenuLink('Ledgers',
|
array('controller' => 'ledgers', 'action' => 'index'), null,
|
||||||
array('controller' => 'ledgers', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Tenders',
|
||||||
$this->addSideMenuLink('Tenders',
|
array('controller' => 'tenders', 'action' => 'index'), null,
|
||||||
array('controller' => 'tenders', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Transactions',
|
||||||
$this->addSideMenuLink('Transactions',
|
array('controller' => 'transactions', 'action' => 'index'), null,
|
||||||
array('controller' => 'transactions', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Ldgr Entries',
|
||||||
$this->addSideMenuLink('Ldgr Entries',
|
array('controller' => 'ledger_entries', 'action' => 'index'), null,
|
||||||
array('controller' => 'ledger_entries', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Stmt Entries',
|
||||||
$this->addSideMenuLink('Stmt Entries',
|
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
||||||
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
$this->addSideMenuLink('Assess Charges',
|
||||||
$this->addSideMenuLink('Assess Charges',
|
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
||||||
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
'SITE', $this->admin_area);
|
||||||
'SITE', $this->admin_area);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->params['dev']) {
|
|
||||||
$this->addSideMenuLink('Un-Nuke',
|
|
||||||
'#', array('htmlAttributes' =>
|
|
||||||
array('onclick' => '$(".pr-section").show(); return false;')),
|
|
||||||
'SITE', $this->dev_area);
|
|
||||||
$this->addSideMenuLink('New Ledgers',
|
|
||||||
array('controller' => 'accounts', 'action' => 'newledger'), null,
|
|
||||||
'SITE', $this->dev_area);
|
|
||||||
//array('name' => 'RESET DATA', array('controller' => 'accounts', 'action' => 'reset_data'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$this->addSideMenuLink('Un-Nuke',
|
||||||
|
'#', array('htmlAttributes' =>
|
||||||
|
array('onclick' => '$(".pr-section").show(); return false;')),
|
||||||
|
'SITE', $this->dev_area);
|
||||||
|
$this->addSideMenuLink('New Ledgers',
|
||||||
|
array('controller' => 'accounts', 'action' => 'newledger'), null,
|
||||||
|
'SITE', $this->dev_area);
|
||||||
|
//array('name' => 'RESET DATA', array('controller' => 'accounts', 'action' => 'reset_data'));
|
||||||
|
|
||||||
$this->sideMenuAreaName('Operations', 'SITE', $this->op_area);
|
$this->sideMenuAreaName('Operations', 'SITE', $this->op_area);
|
||||||
}
|
}
|
||||||
@@ -274,6 +269,13 @@ class AppController extends Controller {
|
|||||||
|
|
||||||
$this->addDefaultSideMenuLinks();
|
$this->addDefaultSideMenuLinks();
|
||||||
$this->sideMenuEnable('SITE', $this->op_area, false);
|
$this->sideMenuEnable('SITE', $this->op_area, false);
|
||||||
|
|
||||||
|
foreach ($this->sidemenu['areas'] AS $area_name => $area) {
|
||||||
|
if (empty($this->params['dev']))
|
||||||
|
$this->sideMenuEnable($area_name, $this->dev_area, false);
|
||||||
|
if (empty($this->params['admin']))
|
||||||
|
$this->sideMenuEnable($area_name, $this->admin_area, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -204,10 +204,10 @@ class AccountsController extends AppController {
|
|||||||
|
|
||||||
$this->addSideMenuLink('New Ledger',
|
$this->addSideMenuLink('New Ledger',
|
||||||
array('action' => 'newledger', $id), null,
|
array('action' => 'newledger', $id), null,
|
||||||
'ACTION');
|
'ACTION', $this->admin_area);
|
||||||
$this->addSideMenuLink('Collected',
|
$this->addSideMenuLink('Collected',
|
||||||
array('action' => 'collected', $id), null,
|
array('action' => 'collected', $id), null,
|
||||||
'ACTION');
|
'ACTION', $this->admin_area);
|
||||||
|
|
||||||
// Prepare to render
|
// Prepare to render
|
||||||
$title = 'Account: ' . $account['Account']['name'];
|
$title = 'Account: ' . $account['Account']['name'];
|
||||||
|
|||||||
@@ -424,14 +424,13 @@ class TransactionsController extends AppController {
|
|||||||
array('action' => 'deposit_slip', $id), null,
|
array('action' => 'deposit_slip', $id), null,
|
||||||
'ACTION');
|
'ACTION');
|
||||||
|
|
||||||
if ($this->params['dev'])
|
$this->addSideMenuLink('Destroy',
|
||||||
$this->addSideMenuLink('Destroy',
|
array('action' => 'destroy', $id),
|
||||||
array('action' => 'destroy', $id),
|
array('confirmMessage' =>
|
||||||
array('confirmMessage' =>
|
"This may leave the database in an unstable state." .
|
||||||
"This may leave the database in an unstable state." .
|
" Do NOT do this unless you know what you're doing." .
|
||||||
" Do NOT do this unless you know what you're doing." .
|
" Proceed anyway?"),
|
||||||
" Proceed anyway?"),
|
'ACTION', $this->dev_area);
|
||||||
'ACTION', $this->dev_area);
|
|
||||||
|
|
||||||
// OK, prepare to render.
|
// OK, prepare to render.
|
||||||
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
||||||
|
|||||||
Reference in New Issue
Block a user