Added in Shipments auto complete
This commit is contained in:
parent
fa6916b862
commit
aacf53b21b
|
|
@ -117,18 +117,12 @@ class PurchaseOrdersController extends AppController {
|
|||
}
|
||||
|
||||
|
||||
function getdata($id) {
|
||||
$po = $this->PurchaseOrder->read(null, $id);
|
||||
$this->set('po_json', json_encode($po));
|
||||
}
|
||||
|
||||
|
||||
/*function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for PurchaseOrder', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->PurchaseOrder->del($id)) {
|
||||
$this->Session->setFlash(__('PurchaseOrder deleted', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
?>
|
||||
1
views/purchase_orders/getdata.ctp
Normal file
1
views/purchase_orders/getdata.ctp
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=($po_json)?>
|
||||
|
|
@ -96,6 +96,17 @@ $(function() {
|
|||
|
||||
if($('#PurchaseOrderID_'+ui.item.id).length == 0) { //This PO is already in the List. Don't do anything.'
|
||||
addToList('PurchaseOrder', ui.item.id, ui.item.value, $('#purchaseOrdersList'));
|
||||
|
||||
$.getJSON('/purchase_orders/getdata/'+ui.item.id, function(data) {
|
||||
console.log(data);
|
||||
//alert(data.Principle.id+' '+data.Principle.name);
|
||||
addToList('Principle', data.Principle.id, data.Principle.name, $('#principlesList'));
|
||||
|
||||
$.each(data.Job, function(key, job) {
|
||||
addToList('Job',job.id, job.title, $('#jobsList'));
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue