$left_joins .= ' left join tt_roles r on (u.role_id = r.id)';
$where_part = " where u.team_id = $this->team_id";
- if (isset($options['status'])) $where_part .= ' and u.status = '.(int)$options['status'];
+ if (isset($options['status']))
+ $where_part .= ' and u.status = '.(int)$options['status'];
+ else
+ $where_part .= ' and u.status is not null';
if ($includeSelf) {
$where_part .= " and (u.id = $this->id || r.rank <= ".(int)$options['max_rank'].')';
} else {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.72.4174 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.73.4175 | 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>
'data'=>$include_options,
'empty'=>array(''=>$i18n->get('dropdown.all'))));
-if ($user->canManageTeam() && $user->isPluginEnabled('ps')) {
- $form->addInput(array('type'=>'combobox',
- 'name'=>'paid_status',
- 'style'=>'width: 250px;',
- 'data'=>array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid')),
- 'empty'=>array(''=>$i18n->get('dropdown.all'))
- ));
-}
-
-
// Add invoiced / not invoiced selector.
$invoice_options = array('1'=>$i18n->get('form.reports.include_invoiced'),
'2'=>$i18n->get('form.reports.include_not_invoiced'));
'data'=>$invoice_options,
'empty'=>array(''=>$i18n->get('dropdown.all'))));
+if ($user->canManageTeam() && $user->isPluginEnabled('ps')) {
+ $form->addInput(array('type'=>'combobox',
+ 'name'=>'paid_status',
+ 'style'=>'width: 250px;',
+ 'data'=>array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid')),
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))
+ ));
+}
+
$user_list = array();
-if ($user->canManageTeam() || $user->isClient()) {
+if ($user->can('view_reports') || $user->isClient()) {
// Prepare user and assigned projects arrays.
- if ($user->canManageTeam())
- $users = ttTeamHelper::getUsers(); // Active and inactive users for managers.
+ if ($user->can('view_reports')) {
+ // $users = ttTeamHelper::getUsers(); // Active and inactive users for managers.
+ if ($user->can('view_own_reports'))
+ $options = array('max_rank'=>$user->rank-1,'include_self'=>true);
+ else
+ $options = array('max_rank'=>$user->rank-1);
+ $users = $user->getUsers($options); // Active and inactive users for managers.
+ }
elseif ($user->isClient())
$users = ttTeamHelper::getUsersForClient(); // Active and inactive users for clients.