$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'])
$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'])
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.
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.