diff --git a/module/bug/model.php b/module/bug/model.php index de5edeb1bf..64c6001068 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1868,6 +1868,8 @@ class bugModel extends model if(!empty($this->config->isINT)) $firstLetter = ''; $users[$account] = $firstLetter . ($user->realname ? $user->realname : $user->account); } + + $users = $this->loadModel('user')->processAccountSort($users); return array('' => '') + $users; } diff --git a/module/user/model.php b/module/user/model.php index 52cc9b3269..f07db87f87 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -136,6 +136,9 @@ class userModel extends model } } + // Put the current user first. + $users = $this->processAccountSort($users); + /* Append empty, closed, and guest users. */ if(strpos($params, 'noempty') === false) $users = array('' => '') + $users; if(strpos($params, 'noclosed') === false) $users = $users + array('closed' => 'Closed'); @@ -2623,6 +2626,10 @@ class userModel extends model if(!empty($this->config->isINT)) $firstLetter = ''; $users[$account] = $firstLetter . ($user->realname ? $user->realname : $user->account); } + + // Put the current user first. + $users = $this->processAccountSort($users); + return array('' => '') + $users; } @@ -2828,4 +2835,23 @@ class userModel extends model $admins = explode(',', trim($company->admins, ',')); $this->app->user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($admins[0])->fetch(); } + + /** + * Put the current user first. + * + * @param array $users + * @access public + * @return array + */ + public function processAccountSort($users = array()) + { + if(isset($users[$this->app->user->account])) + { + $currentUser = array(); + $currentUser[$this->app->user->account] = $users[$this->app->user->account]; + unset($users[$this->app->user->account]); + $users = $currentUser + $users; + } + return $users; + } }