git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@124 97e9348a-65ac-dc4b-aefc-98561f571b83
30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
|
|
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50', 'align' => 'center');
|
|
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
|
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
|
|
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
|
|
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
|
|
$cols['Balance'] = array('index' => 'Lease.balance', 'formatter' => 'currency');
|
|
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'leases',
|
|
'caption' => isset($caption) ? $caption : null);
|
|
|
|
if (isset($leases)) {
|
|
$jqGrid_options += array('custom_ids' =>
|
|
array_map(create_function('$data',
|
|
'return $data["id"];'),
|
|
$leases),
|
|
'limit' => 5);
|
|
}
|
|
else {
|
|
$jqGrid_options += array('search_fields' => array('Customer', 'Unit'));
|
|
}
|
|
|
|
echo $this->element('jqGrid', $jqGrid_options);
|