Files
pmgr/views/elements/customers.ctp
abijah f52fba96c1 Making progress. Much still to do, but there are hints of functionality finally returning so I'm snapshotting.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@360 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-07-21 10:23:52 +00:00

28 lines
1.2 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['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Customer.comment', 'formatter' => 'comment');
// Set up search fields if requested by caller
if (isset($searchfields))
$grid->searchFields(array('Last Name', 'First Name'));
// Include custom data
//$grid->customData(compact('lease_id'));
// Render the grid
$grid
->columns($cols)
->sortField('Name')
->defaultFields(array('ID', 'Name'))
->render($this, isset($config) ? $config : null);