Files
pmgr/site/views/elements/accounts.ctp
abijah 39071b39fb Moved ledgers over the jqGrid. Working reasonably well at the moment.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@131 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-06-15 06:22:38 +00:00

30 lines
1.2 KiB
PHP

<?php /* -*- mode:PHP -*- */
// Define the table columns
$cols = array();
$cols['ID'] = array('index' => 'Account.id', 'formatter' => 'id');
$cols['Name'] = array('index' => 'Account.name', 'formatter' => 'name', 'width' => '250');
$cols['Type'] = array('index' => 'Account.type', 'width' => '60');
$cols['Entries'] = array('index' => 'Account.entries', 'width' => '60', 'align' => 'right');
$cols['Debits'] = array('index' => 'Account.debits', 'formatter' => 'currency');
$cols['Credits'] = array('index' => 'Account.credits', 'formatter' => 'currency');
$cols['Balance'] = array('index' => 'Account.balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment');
$jqGrid_options = array('jqGridColumns' => $cols,
'controller' => 'accounts',
'caption' => isset($caption) ? $caption : null);
if (isset($accounts)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$accounts),
'limit' => 5);
}
else {
$jqGrid_options += array('search_fields' => array('Name'));
}
echo $this->element('jqGrid', $jqGrid_options);