private function _updateOrder()
{
if (is_numeric($this->input->get('id')) and $this->validateForm() === TRUE) {
if ($this->Orders_model->updateOrder($this->input->get('id'), $this->input->post())) {
log_activity($this->user->getStaffId(), 'updated', 'orders', get_activity_message('activity_custom', array('{staff}', '{action}', '{context}', '{link}', '{item}'), array($this->user->getStaffName(), 'updated', 'order', current_url(), '#' . $this->input->get('id'))));
if ($this->input->post('assignee_id') and $this->input->post('old_assignee_id') !== $this->input->post('assignee_id')) {
$staff = $this->Staffs_model->getStaff($this->input->post('assignee_id'));
$staff_assignee = site_url('staffs/edit?id=' . $staff['staff_id']);
log_activity($this->user->getStaffId(), 'assigned', 'orders', get_activity_message('activity_assigned', array('{staff}', '{action}', '{context}', '{link}', '{item}', '{assignee}'), array($this->user->getStaffName(), 'assigned', 'order', current_url(), '#' . $this->input->get('id'), "<a href=\"{$staff_assignee}\">{$staff['staff_name']}</a>")));
}
$this->alert->set('success', sprintf($this->lang->line('alert_success'), 'Order updated'));
} else {
$this->alert->set('warning', sprintf($this->lang->line('alert_error_nothing'), 'updated'));
}
return TRUE;
}
}