]> wagnertech.de Git - timetracker.git/blobdiff - timesheet_add.php
Fixed ttTimesheetHelper::getApprovers function.
[timetracker.git] / timesheet_add.php
index fa32ca7ff59035ead3cfc593a7061ae4acd41027..9e6b9acd073009e408fac5e997595f606bc00087 100644 (file)
@@ -31,7 +31,7 @@ import('form.Form');
 import('ttTimesheetHelper');
 
 // Access checks.
-if (!(ttAccessAllowed('manage_own_timesheets') || ttAccessAllowed('manage_timesheets'))) {
+if (!(ttAccessAllowed('manage_own_timesheets') || ttAccessAllowed('manage_timesheets') || ttAccessAllowed('manage_all_timesheets'))) {
   header('Location: access_denied.php');
   exit();
 }
@@ -64,7 +64,7 @@ if ($request->isPost()) {
     $user_id = $bean->getDetachedAttribute('timesheet_user_id');
     if (!ttTimesheetHelper::getTimesheetByName($cl_name, $user_id)) {
       if (ttTimesheetHelper::insert(array('user_id' => $user_id,
-        // 'client_id' => ?
+        'client_id' => $bean->getAttribute('client'),
         'name' => $cl_name,
         'comment' => $cl_comment))) {
           header('Location: timesheets.php');