<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.71.4166 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.71.4167 | 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>
header('Location: feature_disabled.php');
exit();
}
+if ($user->behalf_id && (!$user->can('track_expenses') || !$user->checkBehalfId())) {
+ header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
+ exit();
+}
+if (!$user->behalf_id && !$user->can('track_own_expenses') && !$user->adjustBehalfId()) {
+ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf.
+ exit();
+}
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
// Elements of expensesForm.
$form = new Form('expensesForm');
-if ($user->canManageTeam()) {
- $user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true));
- if (count($user_list) > 1) {
+if ($user->can('track_expenses')) {
+ if ($user->can('track_own_expenses'))
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_self'=>true,'self_first'=>true);
+ else
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1);
+ $user_list = $user->getUsers($options);
+ if (count($user_list) >= 1) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'this.form.submit();',
'name'=>'onBehalfUser',
header('Location: feature_disabled.php');
exit();
}
+if ($user->behalf_id && (!$user->can('track_expenses') || !$user->checkBehalfId())) {
+ header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
+ exit();
+}
+if (!$user->behalf_id && !$user->can('track_own_expenses') && !$user->adjustBehalfId()) {
+ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf.
+ exit();
+}
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
// Elements of expensesForm.
$form = new Form('expensesForm');
-if ($user->canManageTeam()) {
- $user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true));
- if (count($user_list) > 1) {
+if ($user->can('track_expenses')) {
+ if ($user->can('track_own_expenses'))
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_self'=>true,'self_first'=>true);
+ else
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1);
+ $user_list = $user->getUsers($options);
+ if (count($user_list) >= 1) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'this.form.submit();',
'name'=>'onBehalfUser',
exit();
}
if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId()) {
- header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to view on behalf.
+ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf.
exit();
}
header('Location: feature_disabled.php');
exit();
}
+if ($user->behalf_id && (!$user->can('track_time') || !$user->checkBehalfId())) {
+ header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
+ exit();
+}
+if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId()) {
+ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf.
+ exit();
+}
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
$form = new Form('weekTimeForm');
if ($user->can('track_time')) {
- $user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true));
- if (count($user_list) > 1) {
+ if ($user->can('track_own_time'))
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_self'=>true,'self_first'=>true);
+ else
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1);
+ $user_list = $user->getUsers($options);
+ if (count($user_list) >= 1) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'this.form.submit();',
'name'=>'onBehalfUser',