From 1be8df7a75f8125f882b033b73255cbd6075421d Mon Sep 17 00:00:00 2001 From: abijah Date: Tue, 30 Mar 2010 16:02:43 +0000 Subject: [PATCH] Fixed a sorting issue (depending on point of view). When sorting by date, or effective date, I find it useful to have the next order of sort be entry ID, so they can be viewed in the order actually entered. Ideally, we'll get to a 4 date system: charge-from date, charge-to date, effective date (whatever date the user feels is the right date for the transaction), and _actual_ date, which is the true and correct entry date/time and _not_ user settable. The names of each may need to be different, but that's where we need to head, in which case, we would sort on actual date instead of entry-id. git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@975 97e9348a-65ac-dc4b-aefc-98561f571b83 --- site/controllers/statement_entries_controller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site/controllers/statement_entries_controller.php b/site/controllers/statement_entries_controller.php index bc20932..f4779e4 100644 --- a/site/controllers/statement_entries_controller.php +++ b/site/controllers/statement_entries_controller.php @@ -158,8 +158,11 @@ class StatementEntriesController extends AppController { // defaults into the sort mechanism. If we're already // sorting by one of them, it will only be redundant, // and should cause no harm (possible a longer query?) - $order[] = 'Transaction.stamp ' . $direction; - $order[] = 'StatementEntry.effective_date ' . $direction; + if ($index != 'Transaction.stamp' && + $index != 'StatementEntry.effective_date') { + $order[] = 'Transaction.stamp ' . $direction; + $order[] = 'StatementEntry.effective_date ' . $direction; + } $order[] = 'StatementEntry.id ' . $direction; return $order;