Added unit area to the grid display; removed the hyperlink to unit size (which is not yet implemented), and added an overlocked report.

git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@759 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-24 08:20:28 +00:00
parent 60ec105fca
commit bd4610abb3
3 changed files with 13 additions and 4 deletions

View File

@@ -26,9 +26,13 @@ class UnitsController extends AppController {
function unavailable() { $this->gridView('Unavailable Units'); }
function vacant() { $this->gridView('Vacant Units'); }
function occupied() { $this->gridView('Occupied Units'); }
function locked() { $this->gridView('Overlocked Units'); }
function all() { $this->gridView('All Units', 'all'); }
function gridView($title, $action = null, $element = null) {
$this->addSideMenuLink('Overlocked',
array('controller' => 'units', 'action' => 'locked'), null,
'CONTROLLER');
$this->addSideMenuLink('Occupied',
array('controller' => 'units', 'action' => 'occupied'), null,
'CONTROLLER');
@@ -89,6 +93,7 @@ class UnitsController extends AppController {
function gridDataFields(&$params, &$model) {
$fields = parent::gridDataFields($params, $model);
$fields[] = 'ROUND(UnitSize.width/12 * UnitSize.depth/12, 0) AS sqft';
return array_merge($fields,
$this->Unit->Lease->StatementEntry->chargeDisbursementFields(true));
}
@@ -108,6 +113,9 @@ class UnitsController extends AppController {
elseif ($params['action'] === 'unoccupied') {
$conditions[] = array('NOT' => array($this->Unit->conditionOccupied()));
}
elseif ($params['action'] === 'locked') {
$conditions[] = array('Unit.status' => 'LOCKED');
}
return $conditions;
}
@@ -131,7 +139,7 @@ class UnitsController extends AppController {
function gridDataPostProcessLinks(&$params, &$model, &$records, $links) {
$links['Unit'] = array('name');
$links['UnitSize'] = array('name');
//$links['UnitSize'] = array('name');
return parent::gridDataPostProcessLinks($params, $model, $records, $links);
}

View File

@@ -6,6 +6,7 @@ $cols['Sort'] = array('index' => 'Unit.sort_order', 'hidden' => true);
$cols['Walk'] = array('index' => 'Unit.walk_order', 'formatter' => 'number');
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname');
$cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname');
$cols['Area'] = array('index' => 'sqft', 'formatter' => 'number');
$cols['Rent'] = array('index' => 'Unit.rent', 'formatter' => 'currency');
$cols['Deposit'] = array('index' => 'Unit.deposit', 'formatter' => 'currency');
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'name'); // We have enough real estate