Didnt Fix JS. Its still pretty lame on the Enq register, but it works for now. Set vars in Customer and Users view instead. Ugly hack but its functional. On the list of things to fix
This commit is contained in:
parent
a78f1f0fa5
commit
c45b0f44df
|
|
@ -33,12 +33,18 @@ class CustomersController extends AppController {
|
|||
$this->set('addresses', $this->Customer->Address->findAllByCustomerId($id));
|
||||
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.customer_id' => $id)));
|
||||
$this->set('contacts', $this->Customer->Contact->find('all', array('conditions' => array('customer_id' => $id), 'order' => 'Contact.last_name ASC')));
|
||||
$statuses = $this->Customer->Enquiry->Status->find('all');
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
|
||||
|
||||
|
||||
$statuses = $this->Customer->Enquiry->Status->find('all', array('recursive'=>0));
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$statusid = $status['Status']['id'];
|
||||
$status_list[$statusid] = $status['Status']['name'];
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
|
||||
|
||||
$this->set('parent_industry_list', $this->Customer->Industry->find('list', array('conditions' => array('parent_id' => null))));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ class StatusesController extends AppController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function jsonList($selectedId = null) {
|
||||
|
||||
$statuses = $this->Status->find('all', array('recursive'=>0));
|
||||
|
|
@ -74,8 +76,10 @@ class StatusesController extends AppController {
|
|||
}
|
||||
|
||||
$status_list['selected'] = $selectedId;
|
||||
|
||||
$jsonList = json_encode($status_list);
|
||||
|
||||
$this->set('status_list', $status_list);
|
||||
$this->set('json_status_list', $jsonList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,12 +71,13 @@ class UsersController extends AppController {
|
|||
$this->set('user', $this->User->read(null, $id));
|
||||
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
|
||||
|
||||
$statuses = $this->User->Enquiry->Status->find('all');
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
$statuses = $this->User->Enquiry->Status->find('all', array('recursive'=>0));
|
||||
$status_list = array();
|
||||
foreach ($statuses as $status) {
|
||||
$statusid = $status['Status']['id'];
|
||||
$status_list[$statusid] = $status['Status']['name'];
|
||||
}
|
||||
$this->set('status_list', $status_list);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue