Renamed jqGridData functions to be just gridData. Restructured the virtual function calls with an anticipated need for gridDataCount to be overridden as a whole, instead of just overriding the individual pieces.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@361 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -29,31 +29,31 @@ class LedgersController extends AppController {
|
||||
*/
|
||||
|
||||
function index() { $this->all(); }
|
||||
function current() { $this->jqGridView('Current Ledgers'); }
|
||||
function closed() { $this->jqGridView('Closed Ledgers'); }
|
||||
function all() { $this->jqGridView('All Ledgers', 'all'); }
|
||||
function current() { $this->gridView('Current Ledgers'); }
|
||||
function closed() { $this->gridView('Closed Ledgers'); }
|
||||
function all() { $this->gridView('All Ledgers', 'all'); }
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* virtuals: jqGridData
|
||||
* - With the application controller handling the jqGridData action,
|
||||
* virtuals: gridData
|
||||
* - With the application controller handling the gridData action,
|
||||
* these virtual functions ensure that the correct data is passed
|
||||
* to jqGrid.
|
||||
*/
|
||||
|
||||
function jqGridDataSetup(&$params) {
|
||||
parent::jqGridDataSetup($params);
|
||||
function gridDataSetup(&$params) {
|
||||
parent::gridDataSetup($params);
|
||||
if (!isset($params['action']))
|
||||
$params['action'] = 'all';
|
||||
}
|
||||
|
||||
function jqGridDataCountTables(&$params, &$model) {
|
||||
function gridDataCountTables(&$params, &$model) {
|
||||
return array('contain' => false);
|
||||
}
|
||||
|
||||
function jqGridDataTables(&$params, &$model) {
|
||||
function gridDataTables(&$params, &$model) {
|
||||
return array
|
||||
('link' =>
|
||||
array(// Models
|
||||
@@ -64,14 +64,14 @@ class LedgersController extends AppController {
|
||||
);
|
||||
}
|
||||
|
||||
function jqGridDataFields(&$params, &$model) {
|
||||
function gridDataFields(&$params, &$model) {
|
||||
return array_merge(array('Ledger.*',
|
||||
'CONCAT(Account.id, "-", Ledger.sequence) AS id_sequence'),
|
||||
$this->Ledger->LedgerEntry->debitCreditFields(true));
|
||||
}
|
||||
|
||||
function jqGridDataConditions(&$params, &$model) {
|
||||
$conditions = parent::jqGridDataConditions($params, $model);
|
||||
function gridDataConditions(&$params, &$model) {
|
||||
$conditions = parent::gridDataConditions($params, $model);
|
||||
|
||||
if ($params['action'] === 'current') {
|
||||
$conditions[] = array('NOT' => array('Ledger.closed'));
|
||||
@@ -83,14 +83,14 @@ class LedgersController extends AppController {
|
||||
return $conditions;
|
||||
}
|
||||
|
||||
function jqGridDataOrder(&$params, &$model, $index, $direction) {
|
||||
function gridDataOrder(&$params, &$model, $index, $direction) {
|
||||
$id_sequence = false;
|
||||
if ($index === 'id_sequence') {
|
||||
$id_sequence = true;
|
||||
$index = 'Ledger.account_id';
|
||||
}
|
||||
|
||||
$order = parent::jqGridDataOrder($params, $model, $index, $direction);
|
||||
$order = parent::gridDataOrder($params, $model, $index, $direction);
|
||||
|
||||
if ($id_sequence) {
|
||||
$order[] = 'Ledger.sequence ' . $direction;
|
||||
@@ -99,10 +99,10 @@ class LedgersController extends AppController {
|
||||
return $order;
|
||||
}
|
||||
|
||||
function jqGridRecordLinks(&$params, &$model, &$records, $links) {
|
||||
function gridDataPostProcessLinks(&$params, &$model, &$records, $links) {
|
||||
$links['Ledger'] = array('id_sequence');
|
||||
$links['Account'] = array('name');
|
||||
return parent::jqGridRecordLinks($params, $model, $records, $links);
|
||||
return parent::gridDataPostProcessLinks($params, $model, $records, $links);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user