thanks for an awesome system in groceryCRUD.
Can't find related information to the issue I'm having, perhaps there is an obvious solution I'm missing.
The system I've got set up the in MySQL RDBMS allows a full order to be placed for per depot. Each order has a set of order items (with product descriptions, serial numbers and SKUs that need capturing and updating along the process), and the order is only shipped once order items have been added.
How would I go about linking the addition of adding orders, and from there directly adding order items and updating their info? Would I just use add_action to point to a redirecting function?
public function order()
{
$this->grocery_crud->set_table('orders');
$this->grocery_crud->set_subject('Order');
$this->grocery_crud->set_relation('order_status','order_status','order_status_description');
$this->grocery_crud->set_relation('order_placing_user','user','user_name');
$this->grocery_crud->set_relation('order_fulfillment_user','user','user_name');
$this->grocery_crud->set_relation('order_receipt_user','user','user_name');
$this->grocery_crud->set_relation('order_depot','depot','depot_name');
$this->grocery_crud->add_action('Order Detail', '', 'ui-icon-plus',array($this, 'order_details_link'));
$this->grocery_crud->columns('order_placing_date','order_placing_user','order_status','order_hospital');
$this->grocery_crud->unset_delete();
$output = $this->grocery_crud->render();
$this->_example_output($output);
}
function order_details_link($primary_key, $row)
{
return site_url('main/order_detail').'?order=' . $row->id;
}
I can add the actual main order using the above, but the drill-down for the order_items is not working. It doesn't show the button, create a new order detail view (or automatically edit it) :(
I'm sure I'm doing something obvious wrong - help?