X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/c6aa77a9e6299cf3103f97274e573cc9938c1215..086b93bd5a71b4c68ae3fa3e37d97182ee2a5b73:/timesheet_add.php diff --git a/timesheet_add.php b/timesheet_add.php index e8eb5659..294886be 100644 --- a/timesheet_add.php +++ b/timesheet_add.php @@ -31,7 +31,7 @@ import('form.Form'); import('ttTimesheetHelper'); // Access checks. -if (!(ttAccessAllowed('manage_own_timesheets') || ttAccessAllowed('manage_timesheets') || ttAccessAllowed('manage_all_timesheets'))) { +if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) { header('Location: access_denied.php'); exit(); } @@ -89,18 +89,13 @@ if ($request->isPost()) { if ($err->no() && !ttTimesheetHelper::timesheetItemsExist($fields)) $err->add($i18n->get('error.no_records')); // Finished validating user input. - /* if ($err->no()) { - // 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')); + } } // isPost $smarty->assign('forms', array($form->getName()=>$form->toArray()));