if ($options['show_cost'] && $trackingMode != MODE_TIME) {
$join .= ' left join tt_user_project_binds upb on (l.user_id = upb.user_id and l.project_id = upb.project_id)';
}
+ // Prepare inner joins.
+ $inner_joins = null;
+ if ($user->isPluginEnabled('ts') && $options['timesheet']) {
+ $timesheet_option = $options['timesheet'];
+ if ($timesheet_option == TIMESHEET_PENDING)
+ $inner_joins .= " inner join tt_timesheets ts on (l.timesheet_id = ts.id and ts.submit_status = 1 and ts.approval_status is null)";
+ else if ($timesheet_option == TIMESHEET_APPROVED)
+ $inner_joins .= " inner join tt_timesheets ts on (l.timesheet_id = ts.id and ts.approval_status = 1)";
+ else if ($timesheet_option == TIMESHEET_NOT_APPROVED)
+ $inner_joins .= " inner join tt_timesheets ts on (l.timesheet_id = ts.id and ts.approval_status = 0)";
+ }
+ $join .= $inner_joins;
return $join;
}
// makeJoinExpensesPart builds a left join part for getSubtotals query for expense items.
static function makeJoinExpensesPart($options) {
+ global $user;
+
if (ttReportHelper::groupingBy('user', $options)) {
$join .= ' left join tt_users u on (ei.user_id = u.id)';
}
if (ttReportHelper::groupingBy('project', $options)) {
$join .= ' left join tt_projects p on (ei.project_id = p.id)';
}
+ // Prepare inner joins.
+ $inner_joins = null;
+ if ($user->isPluginEnabled('ts') && $options['timesheet']) {
+ $timesheet_option = $options['timesheet'];
+ if ($timesheet_option == TIMESHEET_PENDING)
+ $inner_joins .= " inner join tt_timesheets ts on (ei.timesheet_id = ts.id and ts.submit_status = 1 and ts.approval_status is null)";
+ else if ($timesheet_option == TIMESHEET_APPROVED)
+ $inner_joins .= " inner join tt_timesheets ts on (ei.timesheet_id = ts.id and ts.approval_status = 1)";
+ else if ($timesheet_option == TIMESHEET_NOT_APPROVED)
+ $inner_joins .= " inner join tt_timesheets ts on (ei.timesheet_id = ts.id and ts.approval_status = 0)";
+ }
+ $join .= $inner_joins;
return $join;
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.37.4761 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.37.4762 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>