Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 23691bab676475d26860aca76555cb6e057a270a 1 parent 4fa7c29
@edavis10 authored
View
8 app/views/settings/_timesheet_settings.rhtml
@@ -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>
View
3  config/locales/en.yml
@@ -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
7 init.rb
@@ -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
View
10 test/integration/configuration_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.