21 lines
908 B
PHP
21 lines
908 B
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['Name'] = array('index' => 'Account.name', 'formatter' => 'longname');
|
|
$cols['Type'] = array('index' => 'Account.type', 'formatter' => 'enum');
|
|
$cols['Entries'] = array('index' => 'entries', 'formatter' => 'number');
|
|
$cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency');
|
|
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
|
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
|
$cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment');
|
|
|
|
// Render the grid
|
|
$grid
|
|
->columns($cols)
|
|
->sortField('Name')
|
|
->defaultFields(array('Name'))
|
|
->searchFields(array('Name'))
|
|
->render($this, isset($config) ? $config : null,
|
|
array_diff(array_keys($cols), array('Comment')));
|