Permalink
Browse files

Sortowanie użytkowników po pozycji

  • Loading branch information...
swistak committed Jan 21, 2012
1 parent 4cba6a3 commit 225e627b19cb86479ce9bdd7edb642994e06d491
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/views/my/blocks/_user_queries.html.erb
@@ -9,7 +9,7 @@
</tr>
</thead>
<tbody>
- <% User.find(:all, :conditions => {:status => 1}, :order => "firstname ASC").each do |user|
+ <% User.find(:all, :conditions => {:status => 1}, :order => "firstname ASC").sort_by{|u| v = u.custom_value_for(2); v ? v.value.to_i : 2 }.each do |user|
issue_count = Issue.count(:conditions => {:assigned_to_id => user.id}, :include => [:status], :group => "#{IssueStatus.table_name}.is_closed").to_hash
%>
<tr class="<%= cycle('odd', 'even') %> <%= 'empty' if issue_count == 0 %>">
@@ -23,4 +23,4 @@
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'my_widgets', :plugin => 'redmine_my_widgets' %>
-<% end %>
+<% end %>

0 comments on commit 225e627

Please sign in to comment.