X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttUser.class.php;h=f9edc8cc7a71ebd17a0d02568ef7ee2a51db759c;hb=3209a25c21cd59c6476d820624545963a5a4a857;hp=7f9894efd455ba918378c33d5362ad2439b6b6be;hpb=bdbf162130c02c6a5510205c7704ef7d5e8f22ea;p=timetracker.git diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 7f9894ef..f9edc8cc 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -262,14 +262,19 @@ class ttUser { $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 { if (isset($options['max_rank'])) $where_part .= ' and r.rank <= '.(int)$options['max_rank']; } - $sql = $select_part.$from_part.$left_joins.$where_part; + $order_part = " order by upper(u.name)"; + + $sql = $select_part.$from_part.$left_joins.$where_part.$order_part; $res = $mdb2->query($sql); $user_list = array(); if (is_a($res, 'PEAR_Error')) @@ -305,7 +310,7 @@ class ttUser { $mdb2 = getConnection(); - $sql = "select u.id, u.name, u.login, u.role_id, u.status, u.rate, u.email, r.rank from tt_users u". + $sql = "select u.id, u.name, u.login, u.role_id, u.status, u.rate, u.email from tt_users u". " left join tt_roles r on (u.role_id = r.id)". " where u.id = $user_id and u.team_id = $this->team_id and u.status is not null". " and (r.rank < $this->rank or (r.rank = $this->rank and u.id = $this->id))"; // Users with lesser roles or self.