Select product backlog

pull/6827/head
friflaj 15 years ago
parent f921807105
commit 9c38b0ad64
  1. 14
      app/controllers/backlogs_controller.rb
  2. 4
      app/models/story.rb
  3. 4
      app/views/backlogs/_backlog.html.erb
  4. 1
      config/locales/en.yml
  5. 3
      init.rb
  6. 15
      lib/backlogs_layout_hooks.rb
  7. 2
      lib/query_patch.rb

@ -115,13 +115,19 @@ class BacklogsController < ApplicationController
render :text => story.points_display, :status => 200
end
def select_sprint
def select_issues
@query = Query.new(:name => "_")
@query.project = @project
@query.add_filter("status_id", '*', ['']) # All statuses
@query.add_filter("fixed_version_id", '=', [params[:sprint_id]])
@query.add_filter("backlogs_issue_type", '=', ['any'])
if params[:sprint_id]
@query.add_filter("status_id", '*', ['']) # All statuses
@query.add_filter("fixed_version_id", '=', [params[:sprint_id]])
@query.add_filter("backlogs_issue_type", '=', ['any'])
else
@query.add_filter("status_id", 'o', ['']) # only open
@query.add_filter("fixed_version_id", '!*', ['']) # only unassigned
@query.add_filter("backlogs_issue_type", '=', ['story'])
end
session[:query] = {:project_id => @query.project_id, :filters => @query.filters}

@ -7,8 +7,8 @@ class Story < Issue
{
:order => 'position ASC',
:conditions => [
"parent_id is NULL and project_id = ? and tracker_id in (?) and fixed_version_id is NULL",
project.id, Story.trackers
"parent_id is NULL and project_id = ? and tracker_id in (?) and fixed_version_id is NULL and status_id in (?)",
project.id, Story.trackers, IssueStatus.find(:all, :conditions => ["is_closed = ?", false]).collect {|s| "#{s.id}" }
]
}
}

@ -15,7 +15,7 @@
{
:item => menu_link('Stories/Tasks', {
:controller => 'backlogs',
:action => 'select_sprint',
:action => 'select_issues',
:project_id => @project,
:sprint_id => backlog }),
:for => :sprint
@ -23,7 +23,7 @@
{
:item => menu_link('Stories', {
:controller => 'backlogs',
:action => 'select_project_backlog',
:action => 'select_issues',
:project_id => @project }),
:for => :product
},

@ -14,3 +14,4 @@ en:
label_points_burn_up: Up
label_points_burn_down: Down
field_position: Position
backlogs_product_backlog: "Product backlog"

@ -41,8 +41,7 @@ Redmine::Plugin.register :redmine_backlogs do
:index,
:reorder,
:sprint_date,
:select_sprint,
:select_product_backlog,
:select_issues,
:update,
:burndown ],
:stories => [ :index,

@ -2,21 +2,26 @@ module BacklogsPlugin
module Hooks
class LayoutHook < Redmine::Hook::ViewListener
def view_issues_sidebar_queries_bottom(context={ })
links = ''
sprints = content_tag(:h3, l(:backlogs_sprints))
project = context[:project]
project_id = project.id
Sprint.open_sprints(project).each { |sprint|
links += link_to(sprint.name, {
sprints += link_to(sprint.name, {
:controller => 'backlogs',
:action => 'select_sprint',
:action => 'select_issues',
:project_id => project_id,
:sprint_id => sprint.id
})
links += content_tag(:br)
sprints += content_tag(:br)
}
return content_tag(:div, content_tag(:h3, l(:backlogs_sprints)) + links)
pbl = content_tag(:h3, l(:backlogs_product_backlog)) + link_to(l(:backlogs_product_backlog), {
:controller => 'backlogs',
:action => 'select_issues',
:project_id => project_id }) + content_tag(:br)
return content_tag(:div, pbl + sprints)
end
def view_issues_show_details_bottom(context={ })

@ -43,7 +43,7 @@ module QueryPatch
parentcol = available_columns.select{|c| c.name == :parent}[0]
return cols if cols.include?(parentcol)
return [parentcol] + cols if self.filters.has_key?("backlogs_issue_type")
return [parentcol] + cols if self.filters["backlogs_issue_type"] and self.filters["backlogs_issue_type"][:values] == ['any']
return cols
end

Loading…
Cancel
Save