git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@196 97e9348a-65ac-dc4b-aefc-98561f571b83
37 lines
1.4 KiB
PHP
37 lines
1.4 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' => 'longname');
|
|
$cols['Type'] = array('index' => 'Account.type', 'formatter' => 'name');
|
|
$cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right');
|
|
$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');
|
|
|
|
$custom_post_data = compact('nothing');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'accounts',
|
|
);
|
|
|
|
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
|
|
|
|
|
|
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'));
|
|
}
|
|
|
|
$jqGrid_options += compact('custom_post_data');
|
|
$jqGrid_options['sort_column'] = 'Name';
|
|
echo $this->element('jqGrid', $jqGrid_options);
|