Moved the leases element onto the new grid helper.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@261 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -57,9 +57,12 @@ echo $this->element('contacts',
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Lease History
|
* Lease History
|
||||||
*/
|
*/
|
||||||
echo $this->element('leases',
|
echo $this->element('leases', array
|
||||||
array('caption' => 'Lease History',
|
('config' => array
|
||||||
'leases' => $customer['Lease']));
|
('caption' => 'Lease History',
|
||||||
|
'rows' => $customer['Lease'],
|
||||||
|
'limit' => 5,
|
||||||
|
)));
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|||||||
@@ -14,25 +14,13 @@ $cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'dat
|
|||||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||||
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');
|
||||||
|
|
||||||
$custom_post_data = compact('nothing');
|
// Set up search fields if requested by caller
|
||||||
$jqGrid_options = array('jqGridColumns' => $cols,
|
if (isset($searchfields))
|
||||||
'controller' => 'leases');
|
$grid->searchFields(array('Customer', 'Unit'));
|
||||||
$jqGrid_options += compact('action', 'caption',
|
|
||||||
'grid_div_id', 'grid_div_class', 'grid_id', 'grid_setup',
|
|
||||||
'nolinks', 'limit');
|
|
||||||
|
|
||||||
if (isset($leases)) {
|
// Render the grid
|
||||||
$jqGrid_options += array('custom_ids' =>
|
$grid
|
||||||
array_map(create_function('$data',
|
->columns($cols)
|
||||||
'return $data["id"];'),
|
->sortField('LeaseID')
|
||||||
$leases),
|
->defaultFields(array('LeaseID', 'Lease'))
|
||||||
'limit' => 5);
|
->render($this, isset($config) ? $config : null);
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|||||||
@@ -61,9 +61,11 @@ echo '<div CLASS="detail supporting">' . "\n";
|
|||||||
* Lease History
|
* Lease History
|
||||||
*/
|
*/
|
||||||
|
|
||||||
echo $this->element('leases',
|
echo $this->element('leases', array
|
||||||
array('caption' => 'Lease History',
|
('config' => array
|
||||||
'leases' => $leases));
|
('caption' => 'Lease History',
|
||||||
|
'rows' => $leases,
|
||||||
|
)));
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user