mirror of
https://github.com/redmine/redmine.git
synced 2025-10-30 01:36:04 +01:00
Find visible issues only in ContextMenusController#issues.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4580 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -2,7 +2,8 @@ class ContextMenusController < ApplicationController
|
|||||||
helper :watchers
|
helper :watchers
|
||||||
|
|
||||||
def issues
|
def issues
|
||||||
@issues = Issue.find_all_by_id(params[:ids], :include => :project)
|
@issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
|
||||||
|
|
||||||
if (@issues.size == 1)
|
if (@issues.size == 1)
|
||||||
@issue = @issues.first
|
@issue = @issues.first
|
||||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||||
|
|||||||
@@ -102,4 +102,10 @@ class ContextMenusControllerTest < ActionController::TestCase
|
|||||||
:class => 'icon-del' }
|
:class => 'icon-del' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_context_menu_issue_visibility
|
||||||
|
get :issues, :ids => [1, 4]
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'context_menu'
|
||||||
|
assert_equal [1], assigns(:issues).collect(&:id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user