From: Nik Okuntseff Date: Wed, 12 Dec 2018 18:48:35 +0000 (+0000) Subject: A few fixes to users pages for subgroups. X-Git-Tag: timetracker_1.19-1~426 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bd5a201697a949a00738c890b227eda0948c0bf2;p=timetracker.git A few fixes to users pages for subgroups. --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d7560f93..51675b02 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4637 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4638 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/mobile/users.tpl b/WEB-INF/templates/mobile/users.tpl index ae04bd44..b3af8e20 100644 --- a/WEB-INF/templates/mobile/users.tpl +++ b/WEB-INF/templates/mobile/users.tpl @@ -22,7 +22,7 @@ {if $uncompleted_indicators} {/if} - {if $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)} + {if $u.group_id != $user->group_id || $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)} {$u.name|escape} {else} {$u.name|escape} @@ -54,7 +54,7 @@ {foreach $inactive_users as $u}
- {if $u.rank < $user->rank} + {if $u.group_id != $user->group_id || $u.rank < $user->rank} {$u.name|escape} {else} {$u.name|escape} diff --git a/mobile/users.php b/mobile/users.php index 0c54751d..d6d08457 100644 --- a/mobile/users.php +++ b/mobile/users.php @@ -40,15 +40,16 @@ if (!(ttAccessAllowed('view_users') || ttAccessAllowed('manage_users'))) { // End of access checks. // Prepare a list of active users. +$rank = $user->getMaxRankForGroup($user->getGroup()); if ($user->can('view_users')) $options = array('status'=>ACTIVE,'include_clients'=>true,'include_login'=>true,'include_role'=>true); else /* if ($user->can('manage_users')) */ - $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_clients'=>true,'include_self'=>true,'include_login'=>true,'include_role'=>true); + $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_clients'=>true,'include_self'=>true,'include_login'=>true,'include_role'=>true); $active_users = $user->getUsers($options); // Prepare a list of inactive users. if($user->can('manage_users')) { - $options = array('status'=>INACTIVE,'max_rank'=>$user->rank-1,'include_clients'=>true,'include_login'=>true,'include_role'=>true); + $options = array('status'=>INACTIVE,'max_rank'=>$rank,'include_clients'=>true,'include_login'=>true,'include_role'=>true); $inactive_users = $user->getUsers($options); } diff --git a/users.php b/users.php index d19ba7de..fd9e7593 100644 --- a/users.php +++ b/users.php @@ -39,15 +39,16 @@ if (!(ttAccessAllowed('view_users') || ttAccessAllowed('manage_users'))) { // End of access checks. // Prepare a list of active users. +$rank = $user->getMaxRankForGroup($user->getGroup()); if ($user->can('view_users')) $options = array('status'=>ACTIVE,'include_clients'=>true,'include_login'=>true,'include_role'=>true); else /* if ($user->can('manage_users')) */ - $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_clients'=>true,'include_self'=>true,'include_login'=>true,'include_role'=>true); + $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_clients'=>true,'include_self'=>true,'include_login'=>true,'include_role'=>true); $active_users = $user->getUsers($options); // Prepare a list of inactive users. if($user->can('manage_users')) { - $options = array('status'=>INACTIVE,'max_rank'=>$user->rank-1,'include_clients'=>true,'include_login'=>true,'include_role'=>true); + $options = array('status'=>INACTIVE,'max_rank'=>$rank,'include_clients'=>true,'include_login'=>true,'include_role'=>true); $inactive_users = $user->getUsers($options); }