- // TODO: use $fields.
- if (ttTimesheetHelper::insert(array('user_id' => $user_id,
- 'client_id' => $bean->getAttribute('client'),
- 'name' => $cl_name,
- 'comment' => $cl_comment))) {
- header('Location: timesheets.php');
- exit();
- } else
- $err->add($i18n->get('error.db'));
- } */
+ if (ttTimesheetHelper::createTimesheet($fields)) {
+ header('Location: timesheets.php');
+ exit();
+ } else
+ $err->add($i18n->get('error.db'));
+ }