[PATCH] Add 'Nobody' as the first item in the owner list

Bram rtdevel at lists.wizbit.be
Thu Dec 24 04:52:45 EST 2009


---
 share/html/Elements/SelectOwner |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/share/html/Elements/SelectOwner b/share/html/Elements/SelectOwner
index 6bdb240..9d3f2f1 100755
--- a/share/html/Elements/SelectOwner
+++ b/share/html/Elements/SelectOwner
@@ -50,7 +50,12 @@
 <option value=""<% !$Default ? qq[ selected="selected"] : '' |n %>><%$DefaultLabel%></option>
 %}
 % $Default = 0 unless defined $Default && $Default =~ /^\d+$/;
-% my @formatednames = sort {lc $a->[1] cmp lc $b->[1]} map {[$_, $m->scomp('/Elements/ShowUser', User => $_)]} @users;
+% my $nobody = $users[0];
+% my @formatednames = sort { 
+%    $a->[0] == $nobody ? -1 :
+%        $b->[0] == $nobody ? 1 :
+%            lc $a->[1] cmp lc $b->[1]
+% } map {[$_, $m->scomp('/Elements/ShowUser', User => $_)]} @users;
 %foreach my $UserRef ( @formatednames)  {
 %my $User = $UserRef->[0];
 <option <% ( $User->Id == $Default) ? qq[ selected="selected"] : '' |n %>
-- 
1.5.4.3


--=_7b45cl13ku0w--



More information about the Rt-devel mailing list