Skip to content

Commit

Permalink
added plugin setting to show locked users
Browse files Browse the repository at this point in the history
  • Loading branch information
mwa committed Oct 7, 2011
1 parent bfd7395 commit 12ccdee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/views/settings/_workload.html.erb
@@ -1,4 +1,7 @@
<p>
<label><%= l(:default_measure) %></label>
<%= select_tag "settings[workload_measure]", options_for_select(Workload::Workload::measures_for_select, @settings['workload_measure'].to_i) %>
<br/>
<label><%= l(:show_locked_users) %></label>
<%= check_box_tag "settings[workload_show_locked_users]", "1", @settings['workload_show_locked_users'] == "1" %>
</p>
1 change: 1 addition & 0 deletions config/locales/de.yml
Expand Up @@ -9,3 +9,4 @@ de:
measure_free_capacity: Freie Kapazität
measure_workload: Auslastung
measure_availability: Verfügbarkeit
show_locked_users: Gesperrte Benutzer anzeigen
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -9,3 +9,4 @@ en:
measure_free_capacity: Free capacity
measure_workload: Workload
measure_availability: Availability
show_locked_users: Show locked users
4 changes: 3 additions & 1 deletion lib/workload/workload.rb
Expand Up @@ -149,7 +149,9 @@ def users
:conditions => ["#{Issue.table_name}.assigned_to_id IS NOT NULL"],
:order => "#{Project.table_name}.lft ASC, #{Issue.table_name}.id ASC",
:limit => @max_rows
).collect(&:assigned_to).uniq.reject{ |user| user.locked? }.uniq.sort{ |a,b| a.lastname <=> b.lastname }
).collect(&:assigned_to).uniq.
reject{ |user| Setting.plugin_redmine_workload[:workload_show_locked_users] == "1" ? false : user.locked? }.
uniq.sort{ |a,b| a.lastname <=> b.lastname }
end

def render(options={})
Expand Down

0 comments on commit 12ccdee

Please sign in to comment.