diff --git a/site/controllers/units_controller.php b/site/controllers/units_controller.php index 9fc9a03..a646ac2 100644 --- a/site/controllers/units_controller.php +++ b/site/controllers/units_controller.php @@ -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); } diff --git a/site/views/elements/units.ctp b/site/views/elements/units.ctp index 9ede8e6..0d3653e 100644 --- a/site/views/elements/units.ctp +++ b/site/views/elements/units.ctp @@ -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 diff --git a/todo.notes b/todo.notes index 20d3f2a..31d7a02 100644 --- a/todo.notes +++ b/todo.notes @@ -9,9 +9,6 @@ was in early (VERY early) implementations. At that time, I had to a use temporary variable to keep a running total. It worked, but was MySQL specific. -Unit Size has no controller. Either remove the link from the -units grid, or implement the controller. - Add a move-out charges field to the move-out page. Otherwise, if the balance is zero, the lease will automatically be closed and no more charges are possible. The other option @@ -192,4 +189,7 @@ Add explanatory information on the New Customer page - Customer name can be omitted and will come from primary tenant. - Phone numbers, etc can be added later directly to the contact +Unit Size has no controller. Either remove the link from the +units grid, or implement the controller. +