diff --git a/controllers/principles_controller.php b/controllers/principles_controller.php index 5731e141..5aca7c28 100755 --- a/controllers/principles_controller.php +++ b/controllers/principles_controller.php @@ -30,6 +30,7 @@ class PrinciplesController extends AppController { $status_list[] = array($status['Status']['id'], $status['Status']['name']); } $this->set('status_list', $status_list); + $this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.principle_id' => $id))); } diff --git a/views/customers/find.ctp b/views/customers/find.ctp index c5829cfc..e43cb9bb 100755 --- a/views/customers/find.ctp +++ b/views/customers/find.ctp @@ -9,12 +9,17 @@ echo $form->input('Customer.name', array('Label'=>'Customer Name', 'id'=>'customerName', 'div'=>'ui-widget')); - echo $form->input('Customer.id', array('type'=>'hidden')); + //echo $form->input('Customer.id', array('type'=>'hidden')); - echo $form->end('Find'); + //echo $form->end('Find'); ?> +
| - | + | - | - | - | - | - | - | - | - | - | - | - | + + | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | + | - | - | - | - | - | - | - | - | - | - | - | + + | link(__('View', true), array('controller'=> 'products', 'action'=>'view', $product['id'])); ?> link(__('Edit', true), array('controller'=> 'products', 'action'=>'edit', $product['id'])); ?> diff --git a/webroot/js/autocomplete-customer.js b/webroot/js/autocomplete-customer.js index 1e4fa6c5..6468c36f 100644 --- a/webroot/js/autocomplete-customer.js +++ b/webroot/js/autocomplete-customer.js @@ -3,7 +3,7 @@ * * used in customers/add.ctp * - * Not really an autocomplete, updates a dialog box with similar customer names to try and stop duplicate entries. + * Not an autocomplete anymore, updates a dialog box with similar customer names to try and stop duplicate entries. */ diff --git a/webroot/js/findcustomer.js b/webroot/js/findcustomer.js index 71d072b0..473d48fb 100644 --- a/webroot/js/findcustomer.js +++ b/webroot/js/findcustomer.js @@ -2,22 +2,33 @@ * filename: findcustomer.js * * used in: customers/find.ctp - * @todo: This doesn't update the ID for some reason. + * */ $(function() { + $("#dialog").hide(); - $("#customerName").autocomplete({ - source: "/customers/completeCustomer", - minLength: 3, - select: function(event, ui) { - $("#CustomerId").val(ui.item.id); - } + /*If the user has entered 3 or more characters. Check to see if its similar to existing customers. */ + $("#customerName").change(function () { - }); + if($("#customerName").val().length >= 3) { + $.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) { + $("#similarCustList").html(data); + }); + + + $("#dialog").dialog({ + position: 'center', + width: 400 + }); + + } + + + }) |