Added accounts to the ledger entry grids, since it's tough to figure out what's going on without them. This exposed a problem with the controller name automatically being determined in the Links function, so it now looks for an optional controller parameter.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@141 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -30,12 +30,28 @@ class LedgerEntriesController extends AppController {
|
||||
('link' =>
|
||||
array(// Models
|
||||
'Transaction' =>
|
||||
array('fields' =>
|
||||
array('Transaction.id', 'Transaction.stamp')),
|
||||
array('fields' => array('id', 'stamp'),
|
||||
),
|
||||
|
||||
'DebitLedger' =>
|
||||
array('fields' => array('id', 'name'),
|
||||
// Models
|
||||
'DebitAccount' => array('class' => 'Account',
|
||||
'fields' => array('id', 'name'),
|
||||
),
|
||||
),
|
||||
|
||||
'CreditLedger' =>
|
||||
array('fields' => array('id', 'name'),
|
||||
// Models
|
||||
'CreditAccount' => array('class' => 'Account',
|
||||
'fields' => array('id', 'name'),
|
||||
),
|
||||
),
|
||||
|
||||
'MonetarySource' =>
|
||||
array('fields' =>
|
||||
array('MonetarySource.id', 'MonetarySource.name')),
|
||||
array('fields' => array('id', 'name'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -53,8 +69,11 @@ class LedgerEntriesController extends AppController {
|
||||
}
|
||||
|
||||
function jqGridRecordLinks(&$params, &$model, &$records, $links) {
|
||||
$links['Transaction'] = array('id');
|
||||
$links['LedgerEntry'] = array('id');
|
||||
$links['Transaction'] = array('id');
|
||||
$links['LedgerEntry'] = array('id');
|
||||
$links['DebitAccount'] = array('controller' => 'accounts', 'name');
|
||||
$links['CreditAccount'] = array('controller' => 'accounts', 'name');
|
||||
$links['MonetarySource'] = array('name');
|
||||
return parent::jqGridRecordLinks($params, $model, $records, $links);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user