Decided the Creation menu isn't worth it at the moment, and moved New Deposit back into the Actions menu. Removed Add Customer, since this can and probably will happen directly from the Move-In page. Created an entirely separate Sandbox menu area, since it is of particular interest to the customer.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@825 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -39,7 +39,7 @@ class AppController extends Controller {
|
||||
var $helpers = array('Html', 'Form', 'Javascript', 'Format', 'Time', 'Grid');
|
||||
var $components = array('DebugKit.Toolbar');
|
||||
|
||||
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false));
|
||||
var $sidemenu = array('areas' => array('SITE' => false, 'CONTROLLER' => false, 'ACTION' => false, 'SANDBOX' => false));
|
||||
var $std_area = 10;
|
||||
var $admin_area = 20;
|
||||
var $dev_area = 30;
|
||||
@@ -71,6 +71,8 @@ class AppController extends Controller {
|
||||
$name = Inflector::humanize($this->params['controller']);
|
||||
elseif ($area == 'ACTION')
|
||||
$name = Inflector::humanize(Inflector::singularize($this->params['controller']));
|
||||
elseif ($area == 'SANDBOX')
|
||||
$name = 'Sandbox';
|
||||
|
||||
if (empty($this->sidemenu['areas'][$area]))
|
||||
$this->sidemenu['areas'][$area]
|
||||
@@ -197,22 +199,6 @@ class AppController extends Controller {
|
||||
array('controller' => 'transactions', 'action' => 'deposit'), null,
|
||||
'SITE');
|
||||
|
||||
if (sandbox())
|
||||
$this->addSideMenuLink('Leave Sandbox',
|
||||
((empty($_SERVER['HTTPS']) ? 'http://' : 'https://') .
|
||||
$_SERVER['SERVER_NAME'] .
|
||||
preg_replace("%^/([^/]+)\.sand%", "/$1", $_SERVER['REQUEST_URI'])),
|
||||
null,
|
||||
'SITE');
|
||||
else
|
||||
$this->addSideMenuLink('Sandbox',
|
||||
((empty($_SERVER['HTTPS']) ? 'http://' : 'https://') .
|
||||
$_SERVER['SERVER_NAME'] .
|
||||
preg_replace("%^/([^/]+)%", "/$1.sand", $_SERVER['REQUEST_URI'])),
|
||||
null,
|
||||
'SITE');
|
||||
|
||||
|
||||
$this->addSideMenuLink('Accounts',
|
||||
array('controller' => 'accounts', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
@@ -252,23 +238,38 @@ class AppController extends Controller {
|
||||
$this->addSideMenuLink('New Receipt',
|
||||
array('controller' => 'customers', 'action' => 'receipt'), null,
|
||||
'SITE', $this->op_area);
|
||||
|
||||
$this->addSideMenuLink('New Invoice',
|
||||
array('controller' => 'leases', 'action' => 'invoice'), null,
|
||||
'SITE', $this->op_area);
|
||||
|
||||
$this->addSideMenuLink('Move-In',
|
||||
array('controller' => 'customers', 'action' => 'move_in'), null,
|
||||
'SITE', $this->op_area);
|
||||
|
||||
$this->addSideMenuLink('Move-Out',
|
||||
array('controller' => 'leases', 'action' => 'move_out'), null,
|
||||
'SITE', $this->op_area);
|
||||
$this->addSideMenuLink('New Deposit',
|
||||
array('controller' => 'tenders', 'action' => 'deposit'), null,
|
||||
'SITE', $this->op_area);
|
||||
|
||||
if (sandbox())
|
||||
if (sandbox()) {
|
||||
$this->addSideMenuLink('Rebuild Sandbox',
|
||||
array('controller' => 'util', 'action' => 'rebuild_sandbox'), null,
|
||||
'SITE', $this->op_area);
|
||||
'SANDBOX');
|
||||
$this->addSideMenuLink('Leave Sandbox',
|
||||
((empty($_SERVER['HTTPS']) ? 'http://' : 'https://') .
|
||||
$_SERVER['SERVER_NAME'] .
|
||||
preg_replace("%^/([^/]+)\.sand%", "/$1", $_SERVER['REQUEST_URI'])),
|
||||
null,
|
||||
'SANDBOX');
|
||||
}
|
||||
else {
|
||||
$this->addSideMenuLink('Enter Sandbox',
|
||||
((empty($_SERVER['HTTPS']) ? 'http://' : 'https://') .
|
||||
$_SERVER['SERVER_NAME'] .
|
||||
preg_replace("%^/([^/]+)%", "/$1.sand", $_SERVER['REQUEST_URI'])),
|
||||
null,
|
||||
'SANDBOX');
|
||||
}
|
||||
|
||||
// REVISIT <AP>: 20090824
|
||||
// Depending on preference, we may put this into the gridView
|
||||
@@ -365,7 +366,7 @@ class AppController extends Controller {
|
||||
unset($area);
|
||||
|
||||
// Activate a default section (unless already specified)
|
||||
foreach (array_reverse($this->sidemenu['areas']) AS $area_name => $area) {
|
||||
foreach (array_reverse(array_diff_key($this->sidemenu['areas'], array('SANDBOX'=>1))) AS $area_name => $area) {
|
||||
if (empty($area))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ class CustomersController extends AppController {
|
||||
array('controller' => 'customers', 'action' => 'all'), null,
|
||||
'CONTROLLER');
|
||||
|
||||
$this->addSideMenuLink('New Customer',
|
||||
array('controller' => 'customers', 'action' => 'add'), null,
|
||||
'CONTROLLER', $this->new_area);
|
||||
/* $this->addSideMenuLink('New Customer', */
|
||||
/* array('controller' => 'customers', 'action' => 'add'), null, */
|
||||
/* 'CONTROLLER', $this->new_area); */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ class TransactionsController extends AppController {
|
||||
function invoice() { $this->gridView('Invoices'); }
|
||||
function receipt() { $this->gridView('Receipts'); }
|
||||
function deposit() {
|
||||
$this->addSideMenuLink('New Deposit',
|
||||
array('controller' => 'tenders', 'action' => 'deposit'), null,
|
||||
'CONTROLLER', $this->new_area);
|
||||
/* $this->addSideMenuLink('New Deposit', */
|
||||
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
|
||||
/* 'CONTROLLER', $this->new_area); */
|
||||
$this->gridView('Deposits');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user