Moved transaction listings to jqGrid, and fixed a bug in the jqGrid element wrt. comment columns
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@136 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
<?php
|
||||
|
||||
class TransactionsController extends AppController {
|
||||
var $paginate = array('limit' => 100,
|
||||
'group' => 'Transaction.id',
|
||||
'order' => array('Transaction.stamp' => 'ASC'));
|
||||
|
||||
var $sidemenu_links =
|
||||
array(array('name' => 'Transactions', 'header' => true),
|
||||
array('name' => 'Cleared', 'url' => array('controller' => 'transactions', 'action' => 'cleared')),
|
||||
array('name' => 'Unresolved', 'url' => array('controller' => 'transactions', 'action' => 'unresolved')),
|
||||
array(array('name' => 'Transactions', 'header' => true),
|
||||
array('name' => 'All', 'url' => array('controller' => 'transactions', 'action' => 'all')),
|
||||
);
|
||||
|
||||
|
||||
@@ -26,61 +22,26 @@ class TransactionsController extends AppController {
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: index
|
||||
* - Lists all transactions
|
||||
* action: index / active / closed / all
|
||||
* - Generate a listing of leases
|
||||
*/
|
||||
|
||||
function index() {
|
||||
$this->all();
|
||||
}
|
||||
function index() { $this->all(); }
|
||||
function all() { $this->jqGridView('All Transactions', 'all'); }
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: cleared
|
||||
* - Lists cleared transactions
|
||||
* virtuals: jqGridData
|
||||
* - With the application controller handling the jqGridData action,
|
||||
* these virtual functions ensure that the correct data is passed
|
||||
* to jqGrid.
|
||||
*/
|
||||
|
||||
function cleared() {
|
||||
$this->all();
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: unresolved
|
||||
* - Lists unresolved transactions
|
||||
*/
|
||||
|
||||
function unresolved() {
|
||||
$this->all();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: all
|
||||
* - Lists all transactions
|
||||
*/
|
||||
|
||||
function all() {
|
||||
$this->paginate = array_merge
|
||||
($this->paginate,
|
||||
array('link' =>
|
||||
array(// Models
|
||||
'Customer',
|
||||
'LedgerEntry' => array('DebitLedger', 'CreditLedger')
|
||||
),
|
||||
));
|
||||
|
||||
$title = 'All Transactions';
|
||||
$this->set('title', $title); $this->set('heading', $title);
|
||||
$this->set('transactions', $this->paginate());
|
||||
$this->render('index');
|
||||
function jqGridRecordLinks(&$params, &$model, &$records, $links) {
|
||||
$links['Transaction'] = array('id');
|
||||
return parent::jqGridRecordLinks($params, $model, $records, $links);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user