<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4533 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4534 | 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>
}
// End of access checks.
+$user_id = $user->getUser();
+
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date);
// Prohibit creating another uncompleted record.
if ($err->no()) {
- if (($not_completed_rec = ttTimeHelper::getUncompleted($user->getUser())) && (($cl_finish == '') && ($cl_duration == '')))
+ if (($not_completed_rec = ttTimeHelper::getUncompleted($user_id)) && (($cl_finish == '') && ($cl_duration == '')))
$err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
// Prohibit creating an overlapping record.
if ($err->no()) {
- if (ttTimeHelper::overlaps($user->getUser(), $cl_date, $cl_start, $cl_finish))
+ if (ttTimeHelper::overlaps($user_id, $cl_date, $cl_start, $cl_finish))
$err->add($i18n->get('error.overlap'));
}
if ($err->no()) {
$id = ttTimeHelper::insert(array(
'date' => $cl_date,
- 'user_id' => $user->getUser(),
+ 'user_id' => $user_id,
'group_id' => $user->getGroup(),
'org_id' => $user->org_id,
'client' => $cl_client,
$smarty->assign('next_date', $next_date);
$smarty->assign('prev_date', $prev_date);
-$smarty->assign('time_records', ttTimeHelper::getRecords($user->getUser(), $cl_date));
-$smarty->assign('day_total', ttTimeHelper::getTimeForDay($user->getUser(), $cl_date));
+$smarty->assign('time_records', ttTimeHelper::getRecords($user_id, $cl_date));
+$smarty->assign('day_total', ttTimeHelper::getTimeForDay($user_id, $cl_date));
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
$smarty->assign('task_list', $task_list);
exit();
}
$cl_id = (int)$request->getParameter('id');
-$time_rec = ttTimeHelper::getRecord($cl_id, $user->getUser());
+$user_id = $user->getUser();
+$time_rec = ttTimeHelper::getRecord($cl_id, $user_id);
if (!$time_rec || $time_rec['invoice_id']) {
// Prohibit deleting not ours or invoiced records.
header('Location: access_denied.php');
$err->add($i18n->get('error.range_locked'));
if ($err->no()) {
-
// Delete the record.
- $result = ttTimeHelper::delete($cl_id, $user->getUser());
-
- if ($result) {
+ if (ttTimeHelper::delete($cl_id, $user_id)) {
header('Location: time.php');
exit();
} else {
exit();
}
$cl_id = (int)$request->getParameter('id');
-$time_rec = ttTimeHelper::getRecord($cl_id, $user->getUser());
+$user_id = $user->getUser();
+$time_rec = ttTimeHelper::getRecord($cl_id, $user_id);
if (!$time_rec || $time_rec['invoice_id']) {
// Prohibit editing not ours or invoiced records.
header('Location: access_denied.php');
// 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
if ($uncompleted) {
- $not_completed_rec = ttTimeHelper::getUncompleted($user->getUser());
+ $not_completed_rec = ttTimeHelper::getUncompleted($user_id);
if ($not_completed_rec && ($time_rec['id'] <> $not_completed_rec['id'])) {
// We have another not completed record.
$err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
// Prohibit creating an overlapping record.
if ($err->no()) {
- if (ttTimeHelper::overlaps($user->getUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
+ if (ttTimeHelper::overlaps($user_id, $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
$err->add($i18n->get('error.overlap'));
}
$res = ttTimeHelper::update(array(
'id'=>$cl_id,
'date'=>$new_date->toString(DB_DATEFORMAT),
- 'user_id'=>$user->getUser(),
+ 'user_id'=>$user_id,
'client'=>$cl_client,
'project'=>$cl_project,
'task'=>$cl_task,
exit();
}
$cl_id = (int)$request->getParameter('id');
-$time_rec = ttTimeHelper::getRecord($cl_id, $user->getUser());
+$user_id = $user->getUser();
+$time_rec = ttTimeHelper::getRecord($cl_id, $user_id);
if (!$time_rec || $time_rec['invoice_id']) {
// Prohibit deleting not ours or invoiced records.
header('Location: access_denied.php');
$err->add($i18n->get('error.range_locked'));
if ($err->no()) {
-
// Delete the record.
- $result = ttTimeHelper::delete($cl_id, $user->getUser());
-
- if ($result) {
+ if (ttTimeHelper::delete($cl_id, $user_id)) {
header('Location: time.php');
exit();
} else {
exit();
}
$cl_id = (int)$request->getParameter('id');
-$time_rec = ttTimeHelper::getRecord($cl_id, $user->getUser());
+$user_id = $user->getUser();
+$time_rec = ttTimeHelper::getRecord($cl_id, $user_id);
if (!$time_rec || $time_rec['invoice_id']) {
// Prohibit editing not ours or invoiced records.
header('Location: access_denied.php');
// 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
if ($uncompleted) {
- $not_completed_rec = ttTimeHelper::getUncompleted($user->getUser());
+ $not_completed_rec = ttTimeHelper::getUncompleted($user_id);
if ($not_completed_rec && ($time_rec['id'] <> $not_completed_rec['id'])) {
// We have another not completed record.
$err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
// Prohibit creating an overlapping record.
if ($err->no()) {
- if (ttTimeHelper::overlaps($user->getUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
+ if (ttTimeHelper::overlaps($user_id, $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
$err->add($i18n->get('error.overlap'));
}
$res = ttTimeHelper::update(array(
'id'=>$cl_id,
'date'=>$new_date->toString(DB_DATEFORMAT),
- 'user_id'=>$user->getUser(),
+ 'user_id'=>$user_id,
'client'=>$cl_client,
'project'=>$cl_project,
'task'=>$cl_task,
// 2) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
if ($uncompleted) {
- $not_completed_rec = ttTimeHelper::getUncompleted($user->getUser());
+ $not_completed_rec = ttTimeHelper::getUncompleted($user_id);
if ($not_completed_rec) {
// We have another not completed record.
$err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
// Prohibit creating an overlapping record.
if ($err->no()) {
- if (ttTimeHelper::overlaps($user->getUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish))
+ if (ttTimeHelper::overlaps($user_id, $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish))
$err->add($i18n->get('error.overlap'));
}
$id = ttTimeHelper::insert(array(
'date'=>$new_date->toString(DB_DATEFORMAT),
- 'user_id'=>$user->getUser(),
+ 'user_id'=>$user_id,
'group_id'=>$user->getGroup(),
'org_id' => $user->org_id,
'client'=>$cl_client,