Patch #2015

sort by name in select box to add user to project.

Added by Yuki Shida about 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:2008-10-09
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:UI
Target version:0.8

Description

Pull-down to add user to project is sorted by ID.
This patch changes sort rule; sort by name.

--- app/views/projects/settings/_members.rhtml  (リビジョン 23)
+++ app/views/projects/settings/_members.rhtml  (リビジョン 24)
@@ -43,7 +43,7 @@
 <% if authorize_for('members', 'new') && !users.empty? %>
   <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :
id => @project}, :method => :post) do |f| %>
     <p><label for="member_user_id"><%=l(:label_member_new)%></label><br />
-    <%= f.select :user_id, users.collect{|user| [user.name, user.id]} %>
+    <%= f.select :user_id, users.collect{|user| [user.name, user.id]}.sort_by { |arr| arr[0] 
} %>
     <%= l(:label_role) %>: <%= f.select :role_id, roles.collect{|role| [role.name, role.id]},
 :selected => nil %>
     <%= submit_tag l(:button_add) %></p>
   <% end %>

Related issues

Related to Redmine - Feature #1880: Some Assign To improvements Closed 2008-09-10
Related to Redmine - Patch #1708: 'Assigned to' list sorts by id, not name Closed 2008-07-29
Related to Redmine - Feature #1413: Alphabetical Sorting of Drop-Down Lists Closed 2008-06-09
Related to Redmine - Defect #2170: User display format isn't previewing the format Closed 2008-11-13

Associated revisions

Revision 2010
Added by Jean-Philippe Lang almost 9 years ago

Sort users by their display names so that user dropdown lists are sorted alphabetically (#2015).

History

#1 Updated by Eric Davis almost 9 years ago

(Wrapped diff in pre blocks so it's more readable)

#2 Updated by Mario Moreira almost 9 years ago

Yes, please, accept this patch. I'm using Active Directory integration, and the lastname has more than one name, so finding a user is painfull. This would help alot.

#3 Updated by Mario Moreira almost 9 years ago

The same should happen when editing an issue on the "Assigned to" field.

#4 Updated by Jean-Philippe Lang almost 9 years ago

  • Category changed from Projects to UI
  • Status changed from Resolved to Closed
  • Target version set to 0.8

Fixed at model level in r2010.
New member and Assigned to lists are now alphabetically sorted.

#5 Updated by Artem Vasiliev almost 9 years ago

Mario Moreira wrote:

The same should happen when editing an issue on the "Assigned to" field.

I've made this in my company's fork of Redmine at Github, please see #1841 for details.

#6 Updated by Artem Vasiliev almost 9 years ago

Artem Vasiliev wrote:

Mario Moreira wrote:

The same should happen when editing an issue on the "Assigned to" field.

I've made this in my company's fork of Redmine at Github, please see #1841 for details.

Ah, I see, the fix for this ticket resolves this already.

Also available in: Atom PDF