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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user