git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@826 97e9348a-65ac-dc4b-aefc-98561f571b83
27 lines
1.3 KiB
PHP
27 lines
1.3 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$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' => 'enum');
|
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
|
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
|
|
|
|
if (in_array($this->params['action'], array('vacant', 'unavailable')))
|
|
$grid->invalidFields('Balance');
|
|
|
|
// Render the grid
|
|
$grid
|
|
->columns($cols)
|
|
->sortField('Sort')
|
|
->defaultFields(array('Sort', 'Unit'))
|
|
->searchFields(array('Unit', 'Size', 'Status'))
|
|
->render($this, isset($config) ? $config : null,
|
|
array_diff(array_keys($cols), array('Walk', 'Deposit', 'Comment')));
|