git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@124 97e9348a-65ac-dc4b-aefc-98561f571b83
28 lines
927 B
PHP
28 lines
927 B
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['ID'] = array('index' => 'Unit.id', 'formatter' => 'id');
|
|
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50');
|
|
$cols['Size'] = array('index' => 'UnitSize.name', 'width' => '75');
|
|
$cols['Status'] = array('index' => 'Unit.status', 'width' => '75');
|
|
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'units',
|
|
'caption' => isset($caption) ? $caption : null);
|
|
|
|
if (isset($units)) {
|
|
$jqGrid_options += array('custom_ids' =>
|
|
array_map(create_function('$data',
|
|
'return $data["id"];'),
|
|
$units),
|
|
'limit' => 5);
|
|
}
|
|
else {
|
|
$jqGrid_options += array('search_fields' => array('Unit', 'Size', 'Status'));
|
|
}
|
|
|
|
echo $this->element('jqGrid', $jqGrid_options);
|
|
|