From f5adad48d1f8368ffe4150cdc78700807d49cf2c Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 28 May 2008 16:35:36 -0700 Subject: [PATCH] Added link to issues filtered by query. #1190 --- app/controllers/deliverables_controller.rb | 10 ++++++++++ app/views/deliverables/_deliverable.html.erb | 5 ++++- init.rb | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/deliverables_controller.rb b/app/controllers/deliverables_controller.rb index 070e45c..787eab5 100644 --- a/app/controllers/deliverables_controller.rb +++ b/app/controllers/deliverables_controller.rb @@ -53,6 +53,16 @@ class DeliverablesController < ApplicationController end end + + # Create a query in the session and redirects to the issue list with that query + def issues + @query = Query.new(:name => "_") + @query.project = @project + @query.add_filter("deliverable_id", '=', [params[:deliverable_id]]) + session[:query] = {:project_id => @query.project_id, :filters => @query.filters} + + redirect_to :controller => 'issues', :action => 'index', :project_id => @project.id + end private def find_project diff --git a/app/views/deliverables/_deliverable.html.erb b/app/views/deliverables/_deliverable.html.erb index 9c6d9fd..9ab7d06 100644 --- a/app/views/deliverables/_deliverable.html.erb +++ b/app/views/deliverables/_deliverable.html.erb @@ -29,5 +29,8 @@ :colspan => 4) %> <%= content_tag( - :td, "TODO", :colspan => 4) %> + :td, + content_tag(:p,link_to("Assigned Issues", :action => 'issues', :id => @project.id, :deliverable_id => deliverable.id)), + content_tag(:p,"Edit TODO"), + :colspan => 4) %> diff --git a/init.rb b/init.rb index d53c65c..f5c7968 100644 --- a/init.rb +++ b/init.rb @@ -23,7 +23,7 @@ Redmine::Plugin.register :budget_plugin do project_module :budget_module do - permission :view_budget, { :deliverables => [:index]} + permission :view_budget, { :deliverables => [:index, :issues]} permission :manage_budget, { :deliverables => [:new, :edit, :create, :update, :destroy, :preview]} end