From f2a7f83c82aabe05be6f8ebf0c19c90be6bf8f1d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 21 Jan 2012 11:11:13 +0000 Subject: [PATCH] Adds a <> option for assignee in the context menu (#1102). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8689 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/context_menus/issues.html.erb | 4 ++++ test/functional/context_menus_controller_test.rb | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index ce418af58..135edba99 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -61,6 +61,10 @@
  • <%= l(:field_assigned_to) %>
      + <% if @assignables.include?(User.current) %> +
    • <%= context_menu_link "<< #{l(:label_me)} >>", {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => User.current}, :back_url => @back}, :method => :post, + :disabled => !@can[:update] %>
    • + <% end %> <% @assignables.each do |u| -%>
    • <%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => u}, :back_url => @back}, :method => :post, :selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %>
    • diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb index 426ca67b5..353f31d9d 100644 --- a/test/functional/context_menus_controller_test.rb +++ b/test/functional/context_menus_controller_test.rb @@ -117,6 +117,17 @@ class ContextMenusControllerTest < ActionController::TestCase :class => 'icon-del' } end + def test_context_menu_by_assignable_user_should_include_assigned_to_me_link + @request.session[:user_id] = 2 + get :issues, :ids => [1] + assert_response :success + assert_template 'context_menu' + + assert_tag :tag => 'a', :content => / me /, + :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=2', + :class => '' } + end + def test_context_menu_issue_visibility get :issues, :ids => [1, 4] assert_response :success