}
// getRecords - returns time records for a user for a given date.
- static function getRecords($user_id, $date) {
+ static function getRecords($date) {
// TODO: merge getRecords and getRecordsWithFiles into one function.
global $user;
$mdb2 = getConnection();
+ $user_id = $user->getUser();
$group_id = $user->getGroup();
$org_id = $user->org_id;
// getRecordsWithFiles - returns time records for a user for a given date
// with information whether they have attached files (has_files property).
// A separate fiunction from getRecords because sql here is more complex.
- static function getRecordsWithFiles($user_id, $date) {
+ static function getRecordsWithFiles($date) {
global $user;
$mdb2 = getConnection();
+ $user_id = $user->getUser();
$group_id = $user->getGroup();
$org_id = $user->org_id;
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.19.1.4969 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.19.1.4970 | 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>
{/if}
<td width="5%" class="tableHeader">{$i18n.label.duration}</td>
<td class="tableHeader">{$i18n.label.note}</td>
+ {if $show_files}
+ <td></td>
+ {/if}
<td></td>
<td></td>
</tr>
{/if}
<td align="right" valign="top">{if ($record.duration == '0:00' && $record.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$record.duration}{/if}</td>
<td valign="top">{if $record.comment}{$record.comment|escape}{else} {/if}</td>
+ {if $show_files}
+ {if $record.has_files}
+ <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_files.png"></a></td>
+ {else}
+ <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_file.png"></a></td>
+ {/if}
+ {/if}
<td valign="top" align="center">
{if $record.approved || $record.timesheet_id || $record.invoice_id}
$smarty->assign('next_date', $next_date);
$smarty->assign('prev_date', $prev_date);
-$smarty->assign('time_records', ttTimeHelper::getRecords($user_id, $cl_date));
+$smarty->assign('time_records', ttTimeHelper::getRecords($cl_date));
$smarty->assign('day_total', ttTimeHelper::getTimeForDay($cl_date));
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
-$smarty->assign('time_records', ttTimeHelper::getRecords($user->getUser(), $cl_date));
+$smarty->assign('time_records', ttTimeHelper::getRecords($cl_date));
$smarty->assign('day_total', ttTimeHelper::getTimeForDay($cl_date));
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
} // isPost
$week_total = ttTimeHelper::getTimeForWeek($selected_date);
-$timeRecords = $showFiles? ttTimeHelper::getRecordsWithFiles($user_id, $cl_date) : ttTimeHelper::getRecords($user_id, $cl_date);
+$timeRecords = $showFiles? ttTimeHelper::getRecordsWithFiles($cl_date) : ttTimeHelper::getRecords($cl_date);
$smarty->assign('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);
$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
$smarty->assign('time_records', $records);
+//$showFiles = $user->isPluginEnabled('at');
+//$smarty->assign('show_files', $showFiles);
+
$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'week.tpl');
$smarty->display('index.tpl');