Moved the leases element onto the new grid helper.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@261 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-08 19:22:22 +00:00
parent f77281835d
commit 311d8be646
3 changed files with 20 additions and 27 deletions

View File

@@ -57,9 +57,12 @@ echo $this->element('contacts',
/**********************************************************************
* Lease History
*/
echo $this->element('leases',
array('caption' => 'Lease History',
'leases' => $customer['Lease']));
echo $this->element('leases', array
('config' => array
('caption' => 'Lease History',
'rows' => $customer['Lease'],
'limit' => 5,
)));
/**********************************************************************

View File

@@ -14,25 +14,13 @@ $cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'dat
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
$custom_post_data = compact('nothing');
$jqGrid_options = array('jqGridColumns' => $cols,
'controller' => 'leases');
$jqGrid_options += compact('action', 'caption',
'grid_div_id', 'grid_div_class', 'grid_id', 'grid_setup',
'nolinks', 'limit');
// Set up search fields if requested by caller
if (isset($searchfields))
$grid->searchFields(array('Customer', 'Unit'));
if (isset($leases)) {
$jqGrid_options += array('custom_ids' =>
array_map(create_function('$data',
'return $data["id"];'),
$leases),
'limit' => 5);
}
if (isset($searchfields)) {
$jqGrid_options += array('search_fields' => array('Customer', 'Unit'));
}
$jqGrid_options += compact('custom_post_data');
$jqGrid_options['sort_column'] = 'LeaseID';
echo $this->element('jqGrid', $jqGrid_options);
// Render the grid
$grid
->columns($cols)
->sortField('LeaseID')
->defaultFields(array('LeaseID', 'Lease'))
->render($this, isset($config) ? $config : null);

View File

@@ -61,9 +61,11 @@ echo '<div CLASS="detail supporting">' . "\n";
* Lease History
*/
echo $this->element('leases',
array('caption' => 'Lease History',
'leases' => $leases));
echo $this->element('leases', array
('config' => array
('caption' => 'Lease History',
'rows' => $leases,
)));
/**********************************************************************