flash[:notice] = l(:notice_successful_create)\r
redirect_to :action => 'list', :tab => @custom_field.type\r
end\r
- @trackers = Tracker.find(:all)\r
+ @trackers = Tracker.find(:all, :order => 'position')\r
end\r
\r
def edit\r
flash[:notice] = l(:notice_successful_update)\r
redirect_to :action => 'list', :tab => @custom_field.type\r
end\r
- @trackers = Tracker.find(:all)\r
+ @trackers = Tracker.find(:all, :order => 'position')\r
end\r
def destroy
@members = @project.members.find(:all, :include => [:user, :role])\r
@subprojects = @project.children if @project.children.size > 0\r
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")\r
- @trackers = Tracker.find(:all)\r
+ @trackers = Tracker.find(:all, :order => 'position')\r
@open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
@total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])\r
end
:limit => @issue_pages.items_per_page,\r
:offset => @issue_pages.current.offset \r
end \r
- @trackers = Tracker.find :all\r
+ @trackers = Tracker.find :all, :order => 'position'\r
render :layout => false if request.xhr?\r
end\r
\r
\r
# Show changelog for @project\r
def changelog\r
- @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true])\r
+ @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')\r
if request.get?\r
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }\r
else\r
case params[:detail]\r
when "tracker"\r
@field = "tracker_id"\r
- @rows = Tracker.find :all\r
+ @rows = Tracker.find :all, :order => 'position'\r
@data = issues_by_tracker\r
@report_title = l(:field_tracker)\r
render :template => "reports/issue_report_details"\r
render :template => "reports/issue_report_details" \r
else\r
@queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]\r
- @trackers = Tracker.find(:all)\r
+ @trackers = Tracker.find(:all, :order => 'position')\r
@priorities = Enumeration::get_values('IPRI')\r
@categories = @project.issue_categories\r
@authors = @project.members.collect { |m| m.user }\r
end\r
end\r
@roles = Role.find(:all, :order => 'position')\r
- @trackers = Tracker.find :all\r
+ @trackers = Tracker.find(:all, :order => 'position')\r
@statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')\r
end
end
verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list }
def list
- @tracker_pages, @trackers = paginate :trackers, :per_page => 10\r
+ @tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position'\r
render :action => "list", :layout => false if request.xhr?
end
redirect_to :action => 'list'
end
end
-
+\r
+ def move\r
+ @tracker = Tracker.find(params[:id])\r
+ case params[:position]\r
+ when 'highest'\r
+ @tracker.move_to_top\r
+ when 'higher'\r
+ @tracker.move_higher\r
+ when 'lower'\r
+ @tracker.move_lower\r
+ when 'lowest'\r
+ @tracker.move_to_bottom\r
+ end if params[:position]\r
+ redirect_to :action => 'list'\r
+ end\r
+
def destroy
@tracker = Tracker.find(params[:id])\r
unless @tracker.issues.empty?\r
def available_filters
return @available_filters if @available_filters
@available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
- "tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all).collect{|s| [s.name, s.id.to_s] } },
+ "tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
"priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
"subject" => { :type => :text, :order => 8 },
"created_on" => { :type => :date_past, :order => 9 },
has_many :issues\r
has_many :workflows, :dependent => :delete_all\r
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => 'custom_fields_trackers', :association_foreign_key => 'custom_field_id'\r
+ acts_as_list\r
\r
validates_presence_of :name\r
validates_uniqueness_of :name\r
<table class="list">
<thead><tr>
<th><%=l(:label_tracker)%></th>\r
+ <th><%=l(:button_sort)%></th>
<th></th>
</tr></thead>
<tbody>
<% for tracker in @trackers %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td>
+ <td align="center">
+ <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => tracker, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
+ <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => tracker, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
+ <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => tracker, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
+ <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => tracker, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
+ </td>
<td align="center">
<%= button_to l(:button_delete), { :action => 'destroy', :id => tracker }, :confirm => l(:text_are_you_sure), :class => "button-small" %>\r
</td>
--- /dev/null
+class AddTrackerPosition < ActiveRecord::Migration
+ def self.up
+ add_column :trackers, :position, :integer, :default => 1, :null => false
+ Tracker.find(:all).each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
+ end
+
+ def self.down
+ remove_column :trackers, :position
+ end
+end
* settings are now stored in the database and editable through the application in: Admin -> Settings (config_custom.rb is no longer used)\r
* mail notifications added when a document, a file or an attachment is added\r
* tooltips added on Gantt chart and calender to view the details of the issues\r
-* ability to set the sort order for roles, issue statuses\r
+* ability to set the sort order for roles, trackers, issue statuses\r
* added missing fields to csv export: priority, start date, due date, done ratio\r
* all icons replaced (new icons are based on GPL icon set: "KDE Crystal Diamond 2.5" -by paolino- and "kNeu! Alpha v0.1" -by Pablo Fabregat-)\r
* added back "fixed version" field on issue screen and in filters\r