- /*
- if (!ttProjectHelper::getProjectByName($cl_name)) {
- if (ttProjectHelper::insert(array('name' => $cl_name,
- 'description' => $cl_description,
- 'users' => $cl_users,
- 'tasks' => $cl_tasks,
- 'status' => ACTIVE))) {
- header('Location: projects.php');
+ $user_id = $bean->getDetachedAttribute('timesheet_user_id');
+ if (!ttTimesheetHelper::getTimesheetByName($cl_name, $user_id)) {
+ if (ttTimesheetHelper::insert(array('user_id' => $user_id,
+ 'client_id' => $bean->getAttribute('client'),
+ 'name' => $cl_name,
+ 'comment' => $cl_comment))) {
+ header('Location: timesheets.php');