# 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
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"),
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
<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>
<%= 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>
<%= 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>
default: --
- issue_added
- issue_updated
+issue_list_default_columns:
+ serialized: true
+ default: --
+ - tracker
+ - status
+ - priority
+ - subject
+ - assigned_to
+ - updated_on
\ No newline at end of file
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
setting_autologin: Autologin
setting_date_format: Date format
setting_cross_project_issue_relations: Allow cross-project issue relations
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_user: User
label_user_plural: Users
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
setting_autologin: Autologin
setting_date_format: Format de date
setting_cross_project_issue_relations: Autoriser les relations entre demandes de différents projets
+setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
label_user: Utilisateur
label_user_plural: Utilisateurs
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Zestawienia zmian
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets\r
field_column_names: Columns\r
label_default_columns: Default columns\r
+setting_issue_list_default_columns: Default columns displayed on the issue list\r
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list
label_changeset_plural: Changesets
field_column_names: Columns
label_default_columns: Default columns
+setting_issue_list_default_columns: Default columns displayed on the issue list