[Rt-commit] r2193 - in rt/branches/3.4-RELEASE: . html/Elements

jesse at bestpractical.com jesse at bestpractical.com
Thu Feb 3 12:27:24 EST 2005


Author: jesse
Date: Thu Feb  3 12:27:23 2005
New Revision: 2193

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/html/Elements/SelectOwner
Log:
 r4075 at hualien:  jesse | 2005-02-03T17:27:08.548583Z
 SelectOwner was displaying "Nobody" twice due to smarter backend code that broke the not-so-smart frontend. Fixed the frontend.
 


Modified: rt/branches/3.4-RELEASE/html/Elements/SelectOwner
==============================================================================
--- rt/branches/3.4-RELEASE/html/Elements/SelectOwner	(original)
+++ rt/branches/3.4-RELEASE/html/Elements/SelectOwner	Thu Feb  3 12:27:23 2005
@@ -47,12 +47,10 @@
 %if ($DefaultValue) {
 <OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION>
 %}
-<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION>
 %foreach my $User ( @users)  {
 <OPTION <% ($User->Id == $Default)         && "SELECTED" %> VALUE="<%$User->Id()%>"><%$User->Name()%></OPTION>
 %}
 </SELECT>
-
 <%INIT>
 my @objects;
 my @users;
@@ -73,14 +71,22 @@
 }
 
 my %user_uniq_hash;
+
+
 foreach my $object (@objects) {
 	my $Users = RT::Users->new($session{CurrentUser});
         $Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0); 
         while (my $User = $Users->Next()) {
+                next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later
 	      $user_uniq_hash{$User->Id()} = $User;
         }
 }
+
 @users = sort { uc($a->Name) cmp uc($b->Name) } values %user_uniq_hash; 
+unshift(@users, $RT::Nobody);
+
+
+
 </%INIT>
 
 <%ARGS>


More information about the Rt-commit mailing list