}
return $user_list;
}
+
+ // The getRecentInvoices returns an array of recent invoices (max 3) for a client.
+ static function getRecentInvoices($client_id) {
+ global $user;
+ $mdb2 = getConnection();
+
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
+
+ $sql = "select i.id, i.name from tt_invoices i".
+ " left join tt_clients c on (c.id = i.client_id)".
+ " where i.group_id = $group_id and i.org_id = $org_id and i.status = 1 and c.id = $client_id".
+ " order by i.id desc limit 3";
+ $res = $mdb2->query($sql);
+ $result = array();
+ if (!is_a($res, 'PEAR_Error')) {
+ $dt = new DateAndTime(DB_DATEFORMAT);
+ while ($val = $res->fetchRow()) {
+ $result[] = $val;
+ }
+ }
+ return $result;
+ }
}
return $result;
}
- // The getRecentInvoices returns an array of recent invoices (max 3) for a client.
- static function getRecentInvoices($group_id, $client_id)
- {
- global $user;
-
- $result = array();
- $mdb2 = getConnection();
-
- $sql = "select i.id, i.name from tt_invoices i
- left join tt_clients c on (c.id = i.client_id)
- where i.group_id = $group_id and i.status = 1 and c.id = $client_id
- order by i.id desc limit 3";
- $res = $mdb2->query($sql);
- $result = array();
- if (!is_a($res, 'PEAR_Error')) {
- $dt = new DateAndTime(DB_DATEFORMAT);
- while ($val = $res->fetchRow()) {
- $result[] = $val;
- }
- }
- return $result;
- }
-
// getUserToProjectBinds - obtains all user to project binds for a group.
static function getUserToProjectBinds($group_id) {
$mdb2 = getConnection();
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.29.4638 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.29.4639 | 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>
import('form.Form');
import('form.ActionForm');
import('ttReportHelper');
-import('ttTeamHelper');
+import('ttGroupHelper');
// Access check.
if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports'))) {
if ($user->can('manage_invoices') &&
($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->getAttribute('group_by1')) && !$user->isClient())) {
// Client is selected and we are displaying the invoice column.
- $recent_invoices = ttTeamHelper::getRecentInvoices($user->group_id, $client_id);
+ $recent_invoices = ttGroupHelper::getRecentInvoices($client_id);
if ($recent_invoices) {
$assign_invoice_select_options = array('1'=>$i18n->get('dropdown.all'),'2'=>$i18n->get('dropdown.select'));
$form->addInput(array('type'=>'combobox',