else
case column.name
when :subject
- h((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
+ h((!@project.nil? && @project != issue.project) ? "#{issue.project.name} - " : '') +
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
when :done_ratio
progress_bar(value, :width => '80px')
cattr_reader :operators_by_filter_type
@@available_columns = [
+ QueryColumn.new(:project, :sortable => "#{Project.table_name}.name"),
QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
def columns
if has_default_columns?
- available_columns.select {|c| Setting.issue_list_default_columns.include?(c.name.to_s) }
+ available_columns.select do |c|
+ # Adds the project column by default for cross-project lists
+ Setting.issue_list_default_columns.include?(c.name.to_s) || (c.name == :project && project.nil?)
+ end
else
# preserve the column_names order
column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
end
def test_index
+ Setting.default_language = 'en'
+
get :index
assert_response :success
assert_template 'index.rhtml'
# private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
assert_no_tag :tag => 'a', :content => /Issue on project 2/
+ # project column
+ assert_tag :tag => 'th', :content => /Project/
end
def test_index_should_not_list_issues_when_module_disabled