Commit 34031914d43b200a5dc179d6fb1d0efa9ee0458a

Authored by Andre Miras
1 parent 062f4040b9
Exists in master

added configuration option to turn on/off subproject support, refs #2

Showing 4 changed files with 17 additions and 3 deletions Side-by-side Diff

app/models/task_board_column.rb View file @ 3403191
... ... @@ -16,7 +16,12 @@
16 16  
17 17 def issues(order_column="project_weight")
18 18 @column_statuses = Hash.new
19   - subproject_ids = project.self_and_descendants.collect {|p| p.id}.flatten
  19 + subproject_ids = [project.id]
  20 + include_subprojects = \
  21 + Setting.plugin_redmine_task_board['include_subprojects'].to_i == 1
  22 + if include_subprojects
  23 + subproject_ids = project.self_and_descendants.collect {|p| p.id}.flatten
  24 + end
20 25 self.issue_statuses.order(:name).each do |status|
21 26 @column_statuses[status.id] = Array.new
22 27 issues = Issue.select("issues.*, tbi.is_archived, tbi.#{order_column} as weight, tbi.issue_id") \
app/views/settings/_redmine_task_board_settings.erb View file @ 3403191
  1 +<p>
  2 + <label><%= l(:label_task_board_include_subprojects) %></label>
  3 + <%= check_box_tag 'settings[include_subprojects]', 1, settings['include_subprojects'] %>
  4 +</p>
config/locales/en.yml View file @ 3403191
... ... @@ -17,4 +17,5 @@
17 17 task_board_issue_bulk_edit: Edit Selected Issues
18 18 task_board_not_prioritized: Other Issues
19 19 task_board_prioritized: Prioritized Issues
  20 + label_task_board_include_subprojects: Include subprojects
... ... @@ -14,6 +14,10 @@
14 14 url 'https://github.com/netaustin/redmine_task_board'
15 15 author_url 'http://www.alleyinteractive.com/'
16 16  
  17 + settings :partial => 'settings/redmine_task_board_settings',
  18 + :default => {
  19 + }
  20 +
17 21 project_module :taskboard do
18 22 permission :edit_taskboard, {:projects => :settings, :taskboard => [:create_column, :delete_column, :update_columns]}, :require => :member
19 23 permission :view_taskboard, {:taskboard => [:index, :save, :archive_issues, :unarchive_issue]}, :require => :member