Fixed Job index listing

This commit is contained in:
Karl Cordes 2010-07-08 16:25:55 +10:00
parent d06ceef2ae
commit b20e930935
2 changed files with 37 additions and 25 deletions

View file

@ -4,6 +4,15 @@ class JobsController extends AppController {
var $name = 'Jobs'; var $name = 'Jobs';
var $helpers = array('Html', 'Form'); var $helpers = array('Html', 'Form');
var $paginate = array(
'contain' => false,
'limit' => 150,
'order'=>array('Job.id' => 'desc')
);
function index() { function index() {
//$this->Job->recursive = 1; //$this->Job->recursive = 1;
$this->set('jobs', $this->paginate()); $this->set('jobs', $this->paginate());

View file

@ -1,31 +1,34 @@
<?php <?php
class Job extends AppModel { class Job extends AppModel {
var $name = 'Job'; var $name = 'Job';
var $validate = array( var $validate = array(
'title' => array('notempty'), 'title' => array('notempty'),
'enquiry_id' => array('numeric'), 'enquiry_id' => array('numeric'),
'date_order_received' => array('date'), 'date_order_received' => array('date'),
'domestic_freight_paid_by' => array('notempty'), 'domestic_freight_paid_by' => array('notempty'),
'sale_category' => array('notempty'), 'sale_category' => array('notempty'),
'shipment_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', //The Associations below have been created with all possible keys, those that are not needed can be removed
'conditions' => '', var $belongsTo = array(
'fields' => '',
'order' => '', 'Enquiry' => array(
'counterCache' => true 'className' => 'Enquiry',
) 'foreignKey' => 'enquiry_id',
); 'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => true
)
);