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:
@@ -200,6 +200,9 @@ class AppController extends Controller {
|
||||
$this->addSideMenuLink('Units',
|
||||
array('controller' => 'units', 'action' => 'index'), null,
|
||||
'SITE');
|
||||
$this->addSideMenuLink('Locks',
|
||||
array('controller' => 'locks', 'action' => 'index'), null,
|
||||
'SITE');
|
||||
$this->addSideMenuLink('Leases',
|
||||
array('controller' => 'leases', 'action' => 'index'), null,
|
||||
'SITE');
|
||||
@@ -655,6 +658,9 @@ class AppController extends Controller {
|
||||
$query = array_intersect_key($this->gridDataCountTableSet($params, $model),
|
||||
array('link'=>1, 'contain'=>1));
|
||||
|
||||
// Conditions for the count
|
||||
$query['fields'] = array($this->gridDataCountField($params, $model));
|
||||
|
||||
// Conditions for the count
|
||||
$query['conditions'] = $this->gridDataCountConditionSet($params, $model);
|
||||
|
||||
@@ -684,6 +690,10 @@ class AppController extends Controller {
|
||||
array('link'=>1, 'contain'=>1));
|
||||
}
|
||||
|
||||
function gridDataCountField(&$params, &$model) {
|
||||
return "COUNT(DISTINCT `".$model->alias.'`.`'.$model->primaryKey."`) AS 'count'";
|
||||
}
|
||||
|
||||
function gridDataCountConditions(&$params, &$model) {
|
||||
// Same conditions for counting as for retreiving
|
||||
return $this->gridDataConditions($params, $model);
|
||||
|
||||
Reference in New Issue
Block a user