First pass at listing the customers. Need to figure out how to paginate based on a HABTM relationship.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@22 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -2,7 +2,31 @@
|
||||
|
||||
class ContactsController extends AppController {
|
||||
var $helpers = array('Html');
|
||||
|
||||
|
||||
var $paginate = array('limit' => 100,
|
||||
'order' => array('Contact.last_name' => 'ASC',
|
||||
'Contact.first_name' => 'ASC'));
|
||||
|
||||
function index() {
|
||||
$this->all();
|
||||
}
|
||||
|
||||
function current() {
|
||||
$this->Contact->recursive = 0;
|
||||
$this->set('contacts', $this->paginate(array('Lease.closed_date IS NULL',
|
||||
//'Contact.'
|
||||
)));
|
||||
$this->render('index');
|
||||
}
|
||||
|
||||
function all() {
|
||||
$this->Contact->recursive = 2;
|
||||
|
||||
//$contacts = $this->paginate();
|
||||
$this->set('contacts', $this->paginate());
|
||||
$this->render('index');
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Item.', true));
|
||||
|
||||
Reference in New Issue
Block a user