projects
/
timetracker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8dade98
)
A bit of refactoring.
author
Nik Okuntseff
<support@anuko.com>
Mon, 22 Apr 2019 17:45:08 +0000
(17:45 +0000)
committer
Nik Okuntseff
<support@anuko.com>
Mon, 22 Apr 2019 17:45:08 +0000
(17:45 +0000)
WEB-INF/lib/ttTimeHelper.class.php
patch
|
blob
|
history
WEB-INF/templates/footer.tpl
patch
|
blob
|
history
WEB-INF/templates/week.tpl
patch
|
blob
|
history
mobile/time.php
patch
|
blob
|
history
mobile/timer.php
patch
|
blob
|
history
time.php
patch
|
blob
|
history
week.php
patch
|
blob
|
history
diff --git
a/WEB-INF/lib/ttTimeHelper.class.php
b/WEB-INF/lib/ttTimeHelper.class.php
index
44d9678
..
0d5863e
100644
(file)
--- a/
WEB-INF/lib/ttTimeHelper.class.php
+++ b/
WEB-INF/lib/ttTimeHelper.class.php
@@
-807,11
+807,12
@@
class ttTimeHelper {
}
// getRecords - returns time records for a user for a given date.
}
// 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();
// 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;
$group_id = $user->getGroup();
$org_id = $user->org_id;
@@
-869,10
+870,11
@@
class ttTimeHelper {
// 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.
// 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();
global $user;
$mdb2 = getConnection();
+ $user_id = $user->getUser();
$group_id = $user->getGroup();
$org_id = $user->org_id;
$group_id = $user->getGroup();
$org_id = $user->org_id;
diff --git
a/WEB-INF/templates/footer.tpl
b/WEB-INF/templates/footer.tpl
index
6e00cf3
..
62a5cf4
100644
(file)
--- a/
WEB-INF/templates/footer.tpl
+++ b/
WEB-INF/templates/footer.tpl
@@
-12,7
+12,7
@@
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.19.1.49
69
| Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.19.1.49
70
| 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>
<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>
diff --git
a/WEB-INF/templates/week.tpl
b/WEB-INF/templates/week.tpl
index
6fc08b8
..
33a218a
100644
(file)
--- a/
WEB-INF/templates/week.tpl
+++ b/
WEB-INF/templates/week.tpl
@@
-117,6
+117,9
@@
function fillDropdowns() {
{/if}
<td width="5%" class="tableHeader">{$i18n.label.duration}</td>
<td class="tableHeader">{$i18n.label.note}</td>
{/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>
<td></td>
<td></td>
</tr>
@@
-138,6
+141,13
@@
function fillDropdowns() {
{/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}
<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}
<td valign="top" align="center">
{if $record.approved || $record.timesheet_id || $record.invoice_id}
diff --git
a/mobile/time.php
b/mobile/time.php
index
15069db
..
30c7a40
100644
(file)
--- a/
mobile/time.php
+++ b/
mobile/time.php
@@
-347,7
+347,7
@@
if ($request->isPost()) {
$smarty->assign('next_date', $next_date);
$smarty->assign('prev_date', $prev_date);
$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('day_total', ttTimeHelper::getTimeForDay($cl_date));
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
diff --git
a/mobile/timer.php
b/mobile/timer.php
index
d3a0d0f
..
a8f708a
100644
(file)
--- a/
mobile/timer.php
+++ b/
mobile/timer.php
@@
-290,7
+290,7
@@
$smarty->assign('uncompleted', $uncompleted);
-$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);
$smarty->assign('day_total', ttTimeHelper::getTimeForDay($cl_date));
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
diff --git
a/time.php
b/time.php
index
f6c8475
..
2a2c616
100644
(file)
--- a/
time.php
+++ b/
time.php
@@
-442,7
+442,7
@@
if ($request->isPost()) {
} // isPost
$week_total = ttTimeHelper::getTimeForWeek($selected_date);
} // 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('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);
diff --git
a/week.php
b/week.php
index
f18817d
..
b4a9176
100644
(file)
--- a/
week.php
+++ b/
week.php
@@
-507,6
+507,9
@@
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
$smarty->assign('time_records', $records);
$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');
$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'week.tpl');
$smarty->display('index.tpl');