summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-01 12:04:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-01 12:04:24 +0000
commitc6e61a5f1976b30d068fb70198f3cc0c10e464d3 (patch)
tree0fa15428641c7e9cd9147e3f74f69edea9ca4581 /app
parent514cdacc87e68526488aaf376ec58c3edfb60492 (diff)
downloadredmine-c6e61a5f1976b30d068fb70198f3cc0c10e464d3.tar.gz
redmine-c6e61a5f1976b30d068fb70198f3cc0c10e464d3.zip
Default columns displayed on the issue list can now be selected at application level.
Saved queries can overide this selection. git-svn-id: http://redmine.rubyforge.org/svn/trunk@785 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/query.rb17
-rw-r--r--app/views/settings/edit.rhtml16
2 files changed, 20 insertions, 13 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 30441d260..837b6515a 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -16,12 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class QueryColumn
- attr_accessor :name, :sortable, :default
+ attr_accessor :name, :sortable
def initialize(name, options={})
self.name = name
self.sortable = options[:sortable]
- self.default = options[:default]
end
def default?; default end
@@ -73,12 +72,12 @@ class Query < ActiveRecord::Base
cattr_reader :operators_by_filter_type
@@available_columns = [
- QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position", :default => true),
- QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position", :default => true),
- QueryColumn.new(:priority, :sortable => "#{Issue.table_name}.priority_id", :default => true),
- QueryColumn.new(:subject, :default => true),
- QueryColumn.new(:assigned_to, :sortable => "#{User.table_name}.lastname", :default => true),
- QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default => true),
+ QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
+ QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
+ QueryColumn.new(:priority, :sortable => "#{Issue.table_name}.priority_id"),
+ QueryColumn.new(:subject),
+ QueryColumn.new(:assigned_to, :sortable => "#{User.table_name}.lastname"),
+ QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on"),
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name"),
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
@@ -209,7 +208,7 @@ class Query < ActiveRecord::Base
def columns
if has_default_columns?
- available_columns.select {|c| c.default? }
+ available_columns.select {|c| Setting.issue_list_default_columns.include?(c.name.to_s) }
else
# preserve the column_names order
column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml
index efe8ff640..c3e430c9b 100644
--- a/app/views/settings/edit.rhtml
+++ b/app/views/settings/edit.rhtml
@@ -1,8 +1,8 @@
<h2><%= l(:label_settings) %></h2>
<div id="settings">
-<% form_tag({:action => 'edit'}, :class => "tabular") do %>
-<div class="box">
+<% form_tag({:action => 'edit'}) do %>
+<div class="box tabular">
<p><label><%= l(:setting_app_title) %></label>
<%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p>
@@ -50,7 +50,15 @@
<%= check_box_tag 'settings[sys_api_enabled]', 1, Setting.sys_api_enabled? %><%= hidden_field_tag 'settings[sys_api_enabled]', 0 %></p>
</div>
-<fieldset class="box"><legend><%= l(:label_authentication) %></legend>
+<fieldset class="box"><legend><%= l(:setting_issue_list_default_columns) %></legend>
+<%= hidden_field_tag 'settings[issue_list_default_columns][]', '' %>
+<p><% Query.available_columns.each do |column| %>
+ <label><%= check_box_tag 'settings[issue_list_default_columns][]', column.name, Setting.issue_list_default_columns.include?(column.name.to_s) %>
+ <%= l("field_#{column.name}") %></label>
+<% end %></p>
+</fieldset>
+
+<fieldset class="box tabular"><legend><%= l(:label_authentication) %></legend>
<p><label><%= l(:setting_login_required) %></label>
<%= check_box_tag 'settings[login_required]', 1, Setting.login_required? %><%= hidden_field_tag 'settings[login_required]', 0 %></p>
@@ -64,7 +72,7 @@
<%= check_box_tag 'settings[lost_password]', 1, Setting.lost_password? %><%= hidden_field_tag 'settings[lost_password]', 0 %></p>
</fieldset>
-<fieldset class="box"><legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
+<fieldset class="box tabular"><legend><%= l(:text_issues_ref_in_commit_messages) %></legend>
<p><label><%= l(:setting_commit_ref_keywords) %></label>
<%= text_field_tag 'settings[commit_ref_keywords]', Setting.commit_ref_keywords, :size => 30 %><br /><em><%= l(:text_comma_separated) %></em></p>