diff --git a/controllers/customers_controller.php b/controllers/customers_controller.php index 0f41d0d6..6d3a0ca3 100755 --- a/controllers/customers_controller.php +++ b/controllers/customers_controller.php @@ -37,14 +37,12 @@ class CustomersController extends AppController { $this->set('invoices', $this->Customer->Invoice->find('all', array('conditions'=>array('Invoice.customer_id'=>$id), 'order'=> 'Invoice.id DESC'))); $this->set('jobs', $this->Customer->Job->find('all', array('conditions'=>array('Job.customer_id'=>$id), 'order'=> 'Job.id DESC'))); + $status_list = $this->Customer->Enquiry->Status->getJSON(); + $this->set('status_list', $status_list); + $classNames = $this->Customer->Enquiry->Status->getClassNamesJSON(); + $this->set('class_names', $classNames); - $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)))); diff --git a/controllers/enquiries_controller.php b/controllers/enquiries_controller.php index 22a810ae..a0d146ea 100755 --- a/controllers/enquiries_controller.php +++ b/controllers/enquiries_controller.php @@ -22,8 +22,8 @@ class EnquiriesController extends AppController { function index() { $this->Enquiry->recursive = 0; $this->set('enquiries', $this->paginate()); - $status_list = $this->Enquiry->Status->getJSON(); + $status_list = $this->Enquiry->Status->getJSON(); $this->set('status_list', $status_list); $classNames = $this->Enquiry->Status->getClassNamesJSON(); $this->set('class_names', $classNames); diff --git a/models/status.php b/models/status.php index b5e1d5f3..3b30a584 100755 --- a/models/status.php +++ b/models/status.php @@ -33,4 +33,4 @@ class Status extends AppModel { } -?> \ No newline at end of file +?> diff --git a/views/elements/enquiry_table.ctp b/views/elements/enquiry_table.ctp index 77960b05..d8f9a5c0 100755 --- a/views/elements/enquiry_table.ctp +++ b/views/elements/enquiry_table.ctp @@ -1,7 +1,7 @@ + link('jquery.jeditable.mini'); echo $javascript->link('enquiry_table'); ?> - options(array('url' => $this->passedArgs)); ?> counter(array( \ No newline at end of file +//debug($enquiries);?> diff --git a/webroot/js/enquiry_table.js b/webroot/js/enquiry_table.js index 956c38bd..8a341687 100755 --- a/webroot/js/enquiry_table.js +++ b/webroot/js/enquiry_table.js @@ -1,7 +1,9 @@ $(function() { + console.log("WOOT"); var statusNamesJSON = $("#statusJSONlist").html(); + console.log(statusNamesJSON); var statusNames = $.parseJSON(statusNamesJSON);