function add_check_list($data = array()) { phpgw::import_class('controller.socheck_list'); include_class('controller', 'check_list', 'inc/model/'); $control_id = $data['control_id']; $type = 'component'; $comment = ''; $assigned_to = $data['assigned_to']; $billable_hours = phpgw::get_var('billable_hours', 'float'); $deadline_date_ts = $data['start_date']; $planned_date_ts = $deadline_date_ts; $completed_date_ts = 0; $check_list = new controller_check_list(); $check_list->set_control_id($control_id); $check_list->set_location_code($data['location_code']); $check_list->set_location_id($data['location_id']); $check_list->set_component_id($data['component_id']); $status = controller_check_list::STATUS_NOT_DONE; $check_list->set_status($status); $check_list->set_comment($comment); $check_list->set_deadline($deadline_date_ts); $check_list->set_planned_date($planned_date_ts); $check_list->set_completed_date($completed_date_ts); $check_list->set_assigned_to($assigned_to); $check_list->set_billable_hours($billable_hours); $socheck_list = CreateObject('controller.socheck_list'); if ($check_list->validate() && ($check_list_id = $socheck_list->store($check_list))) { return $check_list_id; } else { return false; } }