git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@136 97e9348a-65ac-dc4b-aefc-98561f571b83
28 lines
1.1 KiB
PHP
28 lines
1.1 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['ID'] = array('index' => 'Transaction.id', 'formatter' => 'id');
|
|
//$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
|
$cols['Timesamp'] = array('index' => 'Transaction.stamp', 'formatter' => 'date');
|
|
$cols['Through'] = array('index' => 'Transaction.through_date', 'formatter' => 'date');
|
|
$cols['Due'] = array('index' => 'Transaction.due_date', 'formatter' => 'date');
|
|
$cols['Comment'] = array('index' => 'Transaction.comment', 'formatter' => 'comment');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'transactions',
|
|
'caption' => isset($caption) ? $caption : null);
|
|
|
|
if (isset($transactions)) {
|
|
$jqGrid_options += array('custom_ids' =>
|
|
array_map(create_function('$data',
|
|
'return $data["id"];'),
|
|
$transactions),
|
|
'limit' => 5);
|
|
}
|
|
else {
|
|
$jqGrid_options += array('search_fields' => array('Due', 'Comment'));
|
|
}
|
|
|
|
echo $this->element('jqGrid', $jqGrid_options);
|