X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/90437750e88c95b0412c3f171617d96d4ce87bb8..db55bdb7b1dd2bcfa793437fe97a6777eb9d93a6:/WEB-INF/lib/ttReportHelper.class.php diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 1b5fc6f1..1f537bbb 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -43,6 +43,12 @@ class ttReportHelper { $group_id = $user->getGroup(); $org_id = $user->org_id; + // A shortcut for timesheets. + if ($options['timesheet_id']) { + $where = " where l.timesheet_id = ".$options['timesheet_id']." and l.group_id = $group_id and l.org_id = $org_id"; + return $where; + } + // Prepare dropdown parts. $dropdown_parts = ''; if ($options['client_id']) @@ -89,6 +95,12 @@ class ttReportHelper { $group_id = $user->getGroup(); $org_id = $user->org_id; + // A shortcut for timesheets. + if ($options['timesheet_id']) { + $where = " where ei.timesheet_id = ".$options['timesheet_id']." and ei.group_id = $group_id and ei.org_id = $org_id"; + return $where; + } + // Prepare dropdown parts. $dropdown_parts = ''; if ($options['client_id']) @@ -154,6 +166,7 @@ class ttReportHelper { array_push($fields, 'l.user_id'); array_push($fields, '1 as type'); // Type 1 is for tt_log entries. array_push($fields, 'l.date'); + array_push($fields, 'l.timesheet_id'); if($canViewReports || $isClient) array_push($fields, 'u.name as user'); // Add client name if it is selected. @@ -261,6 +274,7 @@ class ttReportHelper { array_push($fields, 'ei.user_id'); array_push($fields, '2 as type'); // Type 2 is for tt_expense_items entries. array_push($fields, 'ei.date'); + array_push($fields, 'ei.timesheet_id'); if($canViewReports || $isClient) array_push($fields, 'u.name as user'); // Add client name if it is selected.