Significant changes to work with the new account/ledger structure. Removed much of the auto-generated model association code. Added helper functions into the models to perform model related work, such as model 'stats' (a bad name for a function to return a summary of pertinent financial information from a given model instance). There is a ton of cleanup to do, but first I want to get it all captured.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@81 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -5,11 +5,12 @@ if (isset($heading))
|
||||
elseif (!isset($caption))
|
||||
echo '<h2>'.__('Customers',true).'</h2>';
|
||||
|
||||
$headers = array('ID', 'Name', 'Comment');
|
||||
$headers = array_merge(array('Name'),
|
||||
isset($customers[0]['ContactsCustomer'])
|
||||
? array('Relationship')
|
||||
: array(),
|
||||
array('Comment'));
|
||||
$column_class = array();
|
||||
foreach (array_intersect($headers, array('ID')) AS $k => $v) {
|
||||
$column_class[$k] = 'id';
|
||||
}
|
||||
foreach (array_intersect($headers, array('Comment')) AS $k => $v) {
|
||||
$column_class[$k] = 'comment';
|
||||
}
|
||||
@@ -18,25 +19,30 @@ if (isset($paginator)) {
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records (%start% - %end%) of %count% total', true)));
|
||||
|
||||
$headers = array($paginator->sort('id'),
|
||||
$paginator->sort('name'),
|
||||
$paginator->sort('comment'));
|
||||
$headers = array_merge(array($paginator->sort('name')),
|
||||
isset($customers[0]['ContactsCustomer'])
|
||||
? array($paginator->sort('Relationship', 'type'))
|
||||
: array(),
|
||||
array($paginator->sort('comment')));
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
foreach ($customers as $customer) {
|
||||
$contacts_customer = null;
|
||||
if (isset($customer['ContactsCustomer']))
|
||||
$contacts_customer = $customer['ContactsCustomer'];
|
||||
|
||||
if (isset($customer['Customer']))
|
||||
$customer = $customer['Customer'];
|
||||
|
||||
$rows[] = array($html->link($customer['id'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id'])),
|
||||
$html->link($customer['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id'])),
|
||||
$customer['comment']);
|
||||
$rows[] = array_merge(array($html->link($customer['name'],
|
||||
array('controller' => 'customers',
|
||||
'action' => 'view',
|
||||
$customer['id']))),
|
||||
isset($contacts_customer)
|
||||
? array($contacts_customer['type'])
|
||||
: array(),
|
||||
array($customer['comment']));
|
||||
}
|
||||
|
||||
echo $this->element('table',
|
||||
|
||||
Reference in New Issue
Block a user