git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@124 97e9348a-65ac-dc4b-aefc-98561f571b83
30 lines
1.3 KiB
PHP
30 lines
1.3 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
// Define the table columns
|
|
$cols = array();
|
|
$cols['ID'] = array('index' => 'Customer.id', 'formatter' => 'id');
|
|
if (0) // REVISIT<AP>: Need to figure out how to put this in play
|
|
$cols['Relationship'] = array('index' => 'ContactsCustomer.type', 'width' => '75');
|
|
$cols['Name'] = array('index' => 'Customer.name', 'formatter' => 'longname');
|
|
$cols['Last Name'] = array('index' => 'PrimaryContact.last_name', 'formatter' => 'name');
|
|
$cols['First Name'] = array('index' => 'PrimaryContact.first_name', 'formatter' => 'name');
|
|
$cols['Leases'] = array('index' => 'lease_count', 'width' => '60');
|
|
$cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment');
|
|
|
|
$jqGrid_options = array('jqGridColumns' => $cols,
|
|
'controller' => 'customers',
|
|
'caption' => isset($caption) ? $caption : null);
|
|
|
|
if (isset($customers)) {
|
|
$jqGrid_options += array('custom_ids' =>
|
|
array_map(create_function('$data',
|
|
'return $data["id"];'),
|
|
$customers),
|
|
'limit' => 5);
|
|
}
|
|
else {
|
|
$jqGrid_options += array('search_fields' => array('Last Name', 'First Name'));
|
|
}
|
|
|
|
echo $this->element('jqGrid', $jqGrid_options);
|