return $last_id;
}
+
+ // The getTimesheets obtains timesheets for user.
+ static function getTimesheets($user_id)
+ {
+ global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ // $addPaidStatus = $user->isPluginEnabled('ps');
+ $result = array();
+
+ if ($user->isClient())
+ $client_part = "and ts.client_id = $user->client_id";
+
+ $sql = "select ts.id, ts.name, ts.client_id, c.name as client_name from tt_timesheets ts".
+ " left join tt_clients c on (c.id = ts.client_id)".
+ " where ts.status = 1 and ts.group_id = $group_id and ts.org_id = $org_id and ts.user_id = $user_id".
+ " $client_part order by ts.name";
+ $res = $mdb2->query($sql);
+ $result = array();
+ if (!is_a($res, 'PEAR_Error')) {
+ $dt = new DateAndTime(DB_DATEFORMAT);
+ while ($val = $res->fetchRow()) {
+ //if ($addPaidStatus)
+ // $val['paid'] = ttTimesheetHelper::isPaid($val['id']);
+ $result[] = $val;
+ }
+ }
+ return $result;
+ }
}
return false;
}
-
- // getTimesheets obtains timesheets for user.
- function getTimesheets() {
- return null; // Not implemented.
- }
}
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
'form.timesheets.hint' => 'Use reports to add new timesheets.',
+'form.timesheets.active_timesheets' => 'Active Timesheets',
+'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
'form.timesheets.hint' => 'Используйте отчёты для добавления новых табелей.',
+'form.timesheets.active_timesheets' => 'Активные табели',
+'form.timesheets.inactive_timesheets' => 'Неактивные табели',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Forma izveštaja. Pogledajte primer na https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php
// TODO: translate the following.
// form.timesheets.hint' => 'Use reports to add new timesheets.',
+// 'form.timesheets.active_timesheets' => 'Active Timesheets',
+// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets',
// Invoice form. See example at https://timetracker.anuko.com/invoice.php
// (you can get to this form after generating a report).
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.37.4734 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.37.4735 | 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>
</tr>
{foreach $timesheets as $timesheet}
<tr valign="top" bgcolor="{cycle values="#f5f5f5,#ffffff"}">
- <td>{$invoice.name|escape}</td>
- <td>{$invoice.client_name|escape}</td>
+ <td>{$timesheet.name|escape}</td>
+ <td>{$timesheet.client_name|escape}</td>
<td>{$invoice.date}</td>
{if $user->isPluginEnabled('ps')}
<td>{if $invoice.paid}{$i18n.label.yes}{else}{$i18n.label.no}{/if}</td>
require_once('initialize.php');
import('form.Form');
-import('ttGroupHelper');
+import('ttTimesheetHelper');
// Access checks.
if (!(ttAccessAllowed('view_own_timesheets') ||
}
// End of access checks.
-$timesheets = $user->getTimesheets();
+$timesheets = ttTimesheetHelper::getTimesheets($user->getUser());
$smarty->assign('timesheets', $timesheets);
$smarty->assign('title', $i18n->get('title.timesheets'));