Added more lock functionality, and fixed a couple bugs
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1039 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -13,6 +13,9 @@ class LocksController extends AppController {
|
||||
function addGridViewSideMenuLinks() {
|
||||
parent::addGridViewSideMenuLinks();
|
||||
|
||||
$this->addSideMenuLink('List',
|
||||
array('controller' => 'locks', 'action' => 'all'), null,
|
||||
'CONTROLLER');
|
||||
$this->addSideMenuLink('Add',
|
||||
array('controller' => 'locks', 'action' => 'add'), null,
|
||||
'CONTROLLER');
|
||||
@@ -52,9 +55,15 @@ class LocksController extends AppController {
|
||||
function gridDataFields(&$params, &$model) {
|
||||
$fields = parent::gridDataFields($params, $model);
|
||||
$fields[] = 'COUNT(LocksUnit.id) AS inuse';
|
||||
$fields[] = 'Lock.qty - COUNT(LocksUnit.id) AS avail';
|
||||
return $fields;
|
||||
}
|
||||
|
||||
function gridDataPostProcessLinks(&$params, &$model, &$records, $links) {
|
||||
$links['Lock'] = array('name');
|
||||
return parent::gridDataPostProcessLinks($params, $model, $records, $links);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
|
||||
@@ -83,6 +83,7 @@ class UnitsController extends AppController {
|
||||
function gridDataTables(&$params, &$model) {
|
||||
$link = $this->gridDataCountTables($params, $model);
|
||||
$link['link']['CurrentLease']['StatementEntry'] = array('fields' => array());
|
||||
$link['link']['Lock'];
|
||||
return $link;
|
||||
}
|
||||
|
||||
@@ -254,7 +255,7 @@ class UnitsController extends AppController {
|
||||
$this->status($id, 'OCCUPIED');
|
||||
|
||||
// If we're not liened, we must now just be locked
|
||||
if (!$this->Unit->liened($id))
|
||||
if (!$this->Unit->liened(intval($id)))
|
||||
$this->status($id, 'LOCKED');
|
||||
|
||||
// Otherwise, don't change anything.
|
||||
@@ -371,6 +372,7 @@ class UnitsController extends AppController {
|
||||
array('contain' =>
|
||||
array(// Models
|
||||
'UnitSize',
|
||||
'Lock',
|
||||
'Lease' => array('Customer'),
|
||||
'CurrentLease' => array('Customer')
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user