diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index eadd2ad7..716816e3 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -46,7 +46,7 @@ class IssuesController < ApplicationController
@issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
@issue_pages = Paginator.new self, @issue_count, 25, params['page']
@issues = Issue.find :all, :order => sort_clause,
- :include => [ :assigned_to, :status, :tracker, :project, :priority ],
+ :include => [ :assigned_to, :status, :tracker, :project, :priority, :category ],
:conditions => @query.statement,
:limit => @issue_pages.items_per_page,
:offset => @issue_pages.current.offset
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 284ac565..3053bea7 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -250,7 +250,7 @@ class ProjectsController < ApplicationController
@issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
@issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
@issues = Issue.find :all, :order => sort_clause,
- :include => [ :assigned_to, :status, :tracker, :project, :priority ],
+ :include => [ :assigned_to, :status, :tracker, :project, :priority, :category ],
:conditions => @query.statement,
:limit => @issue_pages.items_per_page,
:offset => @issue_pages.current.offset
diff --git a/app/models/query.rb b/app/models/query.rb
index 400572eb..30441d26 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -211,7 +211,8 @@ class Query < ActiveRecord::Base
if has_default_columns?
available_columns.select {|c| c.default? }
else
- available_columns.select {|c| column_names.include?(c.name) }
+ # preserve the column_names order
+ column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
end
end
diff --git a/app/views/queries/_columns.rhtml b/app/views/queries/_columns.rhtml
index f233f8ef..b03a3277 100644
--- a/app/views/queries/_columns.rhtml
+++ b/app/views/queries/_columns.rhtml
@@ -1,7 +1,27 @@
<% content_tag 'fieldset', :id => 'columns', :style => (query.has_default_columns? ? 'display:none;' : nil) do %>
-<% query.available_columns.each do |column| %>
-
-<% end %>
+
<%= hidden_field_tag 'query[column_names][]', '' %>
+
<%= select_tag 'available_columns', + options_for_select((query.available_columns - query.columns).collect {|column| [l("field_#{column.name}"), column.name]}), + :multiple => true, :size => 10, :style => "width:150px" %> + | +
+ + + |
+ <%= select_tag 'query[column_names][]', + options_for_select(@query.columns.collect {|column| [l("field_#{column.name}"), column.name]}), + :id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px" %> + | +
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', - :onchange => 'if (this.checked) {Element.hide("columns")} else {Element.show("columns")}' %>
+ :onclick => 'if (this.checked) {Element.hide("columns")} else {Element.show("columns")}' %> -<%= render :partial => 'queries/columns', :locals => {:query => query}%> <%= render :partial => 'queries/filters', :locals => {:query => query}%> +<%= render :partial => 'queries/columns', :locals => {:query => query}%> diff --git a/app/views/queries/edit.rhtml b/app/views/queries/edit.rhtml index 17b19cee..1c99ac07 100644 --- a/app/views/queries/edit.rhtml +++ b/app/views/queries/edit.rhtml @@ -1,6 +1,6 @@