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 $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());

View file

@ -1,33 +1,36 @@
<?php
class Job extends AppModel {
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')
);
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
)
);
}
?>