Permalink
Browse files

[#5778] Add configuration option for picking which user types are shown

  • Loading branch information...
1 parent 4fa7c29 commit 23691bab676475d26860aca76555cb6e057a270a @edavis10 committed Apr 21, 2011
Showing with 27 additions and 1 deletion.
  1. +8 −0 app/views/settings/_timesheet_settings.rhtml
  2. +3 −0 config/locales/en.yml
  3. +6 −1 init.rb
  4. +10 −0 test/integration/configuration_test.rb
@@ -9,3 +9,11 @@
l(:text_active_projects) => 'active',
l(:text_all_projects) => 'all'}, @settings['project_status'])) %>
</p>
+
+<p>
+ <label for="settings_user_status"><%= l(:label_user_status) %></label>
+ <%= select_tag('settings[user_status]',
+ options_for_select({
+ l(:text_active_users) => 'active',
+ l(:text_all_users) => 'all'}, @settings['user_status'])) %>
+</p>
@@ -11,4 +11,7 @@ en:
label_show_project_status: "Projects with the status:"
text_active_projects: "Active"
text_all_projects: "All (active and archived)"
+ label_user_status: "Show users with the status of"
+ text_active_users: "Active only"
+ text_all_users: "All"
View
@@ -37,7 +37,12 @@
version '0.6.0'
requires_redmine :version_or_higher => '0.9.0'
- settings :default => {'list_size' => '5', 'precision' => '2', 'project_status' => 'active'}, :partial => 'settings/timesheet_settings'
+ settings(:default => {
+ 'list_size' => '5',
+ 'precision' => '2',
+ 'project_status' => 'active',
+ 'user_status' => 'active'
+ }, :partial => 'settings/timesheet_settings')
permission :see_project_timesheets, { }, :require => :member
@@ -47,4 +47,14 @@ def setup
assert_equal 'all', plugin_configuration['project_status']
end
+
+ should "be able to configure what types of users are shown" do
+ login_as(@user.login, 'test')
+ visit_configuration_panel
+
+ select "All", :from => 'settings_user_status'
+ click_button 'Apply'
+
+ assert_equal 'all', plugin_configuration['user_status']
+ end
end

0 comments on commit 23691ba

Please sign in to comment.