From b20e9309356cb300de03cdc8bb9e6e296380345e Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Thu, 8 Jul 2010 16:25:55 +1000 Subject: [PATCH] Fixed Job index listing --- controllers/jobs_controller.php | 9 ++++++ models/job.php | 53 +++++++++++++++++---------------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php index c82563e5..8955be75 100644 --- a/controllers/jobs_controller.php +++ b/controllers/jobs_controller.php @@ -4,6 +4,15 @@ class JobsController extends AppController { var $name = 'Jobs'; var $helpers = array('Html', 'Form'); + + var $paginate = array( + + 'contain' => false, + 'limit' => 150, + 'order'=>array('Job.id' => 'desc') + + ); + function index() { //$this->Job->recursive = 1; $this->set('jobs', $this->paginate()); diff --git a/models/job.php b/models/job.php index ad8fe2dc..9c5056b2 100644 --- a/models/job.php +++ b/models/job.php @@ -1,33 +1,36 @@ array('notempty'), - - 'enquiry_id' => array('numeric'), - - 'date_order_received' => array('date'), - - 'domestic_freight_paid_by' => array('notempty'), - 'sale_category' => array('notempty'), - 'shipment_category' => array('notempty') - ); + var $name = 'Job'; + var $validate = array( + 'title' => array('notempty'), + + 'enquiry_id' => array('numeric'), + + 'date_order_received' => array('date'), + + 'domestic_freight_paid_by' => array('notempty'), + 'sale_category' => array('notempty'), + 'shipment_category' => array('notempty') + ); + + + + + //The Associations below have been created with all possible keys, those that are not needed can be removed + var $belongsTo = array( + + 'Enquiry' => array( + 'className' => 'Enquiry', + 'foreignKey' => 'enquiry_id', + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'counterCache' => true + ) + ); - //The Associations below have been created with all possible keys, those that are not needed can be removed - var $belongsTo = array( - - 'Enquiry' => array( - 'className' => 'Enquiry', - 'foreignKey' => 'enquiry_id', - 'conditions' => '', - 'fields' => '', - 'order' => '', - 'counterCache' => true - ) - ); - } ?> \ No newline at end of file