Getting sidemenu ready for more dynamic actions based on context. Couple minor tweaks to layout.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@44 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -7,6 +7,13 @@ class ContactsController extends AppController {
|
|||||||
'order' => array('Contact.last_name' => 'ASC',
|
'order' => array('Contact.last_name' => 'ASC',
|
||||||
'Contact.first_name' => 'ASC'));
|
'Contact.first_name' => 'ASC'));
|
||||||
|
|
||||||
|
var $sidemenu_links =
|
||||||
|
array(array('name' => 'Tenants', 'header' => true),
|
||||||
|
array('name' => 'Current', 'url' => array('controller' => 'contacts', 'action' => 'current')),
|
||||||
|
array('name' => 'Past', 'url' => array('controller' => 'contacts', 'action' => 'past')),
|
||||||
|
array('name' => 'All Tenants', 'url' => array('controller' => 'contacts', 'action' => 'tenants')),
|
||||||
|
array('name' => 'All Contacts', 'url' => array('controller' => 'contacts', 'action' => 'all')),
|
||||||
|
);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -15,15 +22,7 @@ class ContactsController extends AppController {
|
|||||||
* - Generates controller specific links for the side menu
|
* - Generates controller specific links for the side menu
|
||||||
*/
|
*/
|
||||||
function sideMenuLinks() {
|
function sideMenuLinks() {
|
||||||
$menu = parent::sideMenuLinks();
|
return array_merge(parent::sideMenuLinks(), $this->sidemenu_links);
|
||||||
//$menu[] = array('hr' => true);
|
|
||||||
$menu[] = array('name' => 'Tenants', 'header' => true);
|
|
||||||
$menu[] = array('name' => 'Current', 'url' => array('controller' => 'contacts', 'action' => 'current'));
|
|
||||||
$menu[] = array('name' => 'Past', 'url' => array('controller' => 'contacts', 'action' => 'past'));
|
|
||||||
$menu[] = array('name' => 'All Tenants', 'url' => array('controller' => 'contacts', 'action' => 'tenants'));
|
|
||||||
$menu[] = array('name' => 'All Contacts', 'url' => array('controller' => 'contacts', 'action' => 'all'));
|
|
||||||
|
|
||||||
return $menu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -159,6 +158,11 @@ class ContactsController extends AppController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Move-Out', 'url' => array('controller' => 'units', 'action' => 'move-out'));
|
||||||
|
|
||||||
$this->set(compact('contact', 'title', 'mytstval',
|
$this->set(compact('contact', 'title', 'mytstval',
|
||||||
'outstanding_balance',
|
'outstanding_balance',
|
||||||
'outstanding_deposit'));
|
'outstanding_deposit'));
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ class UnitsController extends AppController {
|
|||||||
var $paginate = array('limit' => 100,
|
var $paginate = array('limit' => 100,
|
||||||
'order' => array('Unit.sort_order' => 'ASC'));
|
'order' => array('Unit.sort_order' => 'ASC'));
|
||||||
|
|
||||||
|
var $sidemenu_links =
|
||||||
|
array(array('name' => 'Units', 'header' => true),
|
||||||
|
array('name' => 'Occupied', 'url' => array('controller' => 'units', 'action' => 'occupied')),
|
||||||
|
array('name' => 'Vacant', 'url' => array('controller' => 'units', 'action' => 'vacant')),
|
||||||
|
array('name' => 'Unavailable', 'url' => array('controller' => 'units', 'action' => 'unavailable')),
|
||||||
|
array('name' => 'All', 'url' => array('controller' => 'units', 'action' => 'all')),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
@@ -14,15 +22,7 @@ class UnitsController extends AppController {
|
|||||||
* - Generates controller specific links for the side menu
|
* - Generates controller specific links for the side menu
|
||||||
*/
|
*/
|
||||||
function sideMenuLinks() {
|
function sideMenuLinks() {
|
||||||
$menu = parent::sideMenuLinks();
|
return array_merge(parent::sideMenuLinks(), $this->sidemenu_links);
|
||||||
//$menu[] = array('hr' => true);
|
|
||||||
$menu[] = array('name' => 'Units', 'header' => true);
|
|
||||||
$menu[] = array('name' => 'Occupied', 'url' => array('controller' => 'units', 'action' => 'occupied'));
|
|
||||||
$menu[] = array('name' => 'Vacant', 'url' => array('controller' => 'units', 'action' => 'vacant'));
|
|
||||||
$menu[] = array('name' => 'Unavailable', 'url' => array('controller' => 'units', 'action' => 'unavailable'));
|
|
||||||
$menu[] = array('name' => 'All', 'url' => array('controller' => 'units', 'action' => 'all'));
|
|
||||||
|
|
||||||
return $menu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -142,6 +142,11 @@ class UnitsController extends AppController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Operations', 'header' => true);
|
||||||
|
$this->sidemenu_links[] =
|
||||||
|
array('name' => 'Move-Out', 'url' => array('controller' => 'units', 'action' => 'move-out'));
|
||||||
|
|
||||||
$this->set(compact('unit', 'title',
|
$this->set(compact('unit', 'title',
|
||||||
'outstanding_balance',
|
'outstanding_balance',
|
||||||
'outstanding_deposit'));
|
'outstanding_deposit'));
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ foreach($contact['Lease'] AS $lease) {
|
|||||||
|
|
||||||
echo $this->element('table',
|
echo $this->element('table',
|
||||||
array('class' => 'item ledger list',
|
array('class' => 'item ledger list',
|
||||||
'caption' => 'Lease #'.$lease['number'].' ('.$lease['Unit']['name'].')',
|
'caption' => 'Lease #'.$lease['number'].' (Unit: '.$lease['Unit']['name'].')',
|
||||||
'suppress_alternate_rows' => true,
|
'suppress_alternate_rows' => true,
|
||||||
'headers' => $headers,
|
'headers' => $headers,
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ foreach($unit['Lease'] AS $lease) {
|
|||||||
|
|
||||||
echo $this->element('table',
|
echo $this->element('table',
|
||||||
array('class' => 'item ledger list',
|
array('class' => 'item ledger list',
|
||||||
'caption' => 'Lease #'.$lease['number'].' ('.$lease['Contact'][0]['display_name'].')',
|
'caption' => 'Lease #'.$lease['number'].' (Tenant: '.$lease['Contact'][0]['display_name'].')',
|
||||||
'suppress_alternate_rows' => true,
|
'suppress_alternate_rows' => true,
|
||||||
'headers' => $headers,
|
'headers' => $headers,
|
||||||
'rows' => $rows,
|
'rows' => $rows,
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ table.list.ledger td.comment { width : 99%; }
|
|||||||
div.infobox { float: right;
|
div.infobox { float: right;
|
||||||
width: 39%;
|
width: 39%;
|
||||||
margin-top: 1.5em;
|
margin-top: 1.5em;
|
||||||
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.summary { color: #993;
|
div.summary { color: #993;
|
||||||
|
|||||||
Reference in New Issue
Block a user