From 1a349e2b75567385941f36009a93515d044cc65d Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Thu, 23 Jun 2011 16:03:59 +1000 Subject: [PATCH] Added created column to shipments index. Only way to order them correctly is by created timestamp DESC. Trying to order by two columns makes things unpredictable. Click on the column headings to re-order things closes #10 --- models/shipment.php | 2 -- views/elements/shipment_index_all.ctp | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/models/shipment.php b/models/shipment.php index 2333f2ee..55dafc3b 100644 --- a/models/shipment.php +++ b/models/shipment.php @@ -9,8 +9,6 @@ class Shipment extends AppModel { var $recursive = 1; - var $order = array('Shipment.date_arrived' => 'DESC', 'Shipment.date_dispatched'=>'DESC'); - //The Associations below have been created with all possible keys, those that are not needed can be removed var $belongsTo = array( 'FreightForwarder' => array( diff --git a/views/elements/shipment_index_all.ctp b/views/elements/shipment_index_all.ctp index e0787c1f..787bb1cd 100644 --- a/views/elements/shipment_index_all.ctp +++ b/views/elements/shipment_index_all.ctp @@ -1,6 +1,7 @@ + @@ -34,6 +35,14 @@ +
sort('created');?> sort('date_arrived');?> sort('date_dispatched');?> sort('type');?> + + +