- 'approver_id' => $approver_id); // TODO: obtain (and check) approver id above during access checks.
- if (ttTimesheetHelper::submitTimesheet($fields)) {
+ 'approver_id' => $approver_id);
+ if (!ttTimesheetHelper::markSubmitted($fields))
+ $err->add($i18n->get('error.db'));
+ if ($err->no() && !ttTimesheetHelper::sendSubmitEmail($fields)) {
+ $err->add($i18n->get('error.mail_send'));
+ }
+ if ($err->no()) {