layout 'base'
before_filter :require_admin\r
\r
+ verify :method => :post, :only => [ :destroy, :create, :update, :move ],\r
+ :redirect_to => { :action => :list }\r
+ \r
def index
list
render :action => 'list' unless request.xhr?
end
def list
- @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10\r
+ @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position"\r
render :action => "list", :layout => false if request.xhr?
end
else
render :action => 'edit'
end
+ end\r
+ \r
+ def move\r
+ @issue_status = IssueStatus.find(params[:id])\r
+ case params[:position]\r
+ when 'highest'\r
+ @issue_status.move_to_top\r
+ when 'higher'\r
+ @issue_status.move_higher\r
+ when 'lower'\r
+ @issue_status.move_lower\r
+ when 'lowest'\r
+ @issue_status.move_to_bottom\r
+ end if params[:position]\r
+ redirect_to :action => 'list'\r
end
def destroy
include IfpdfHelper\r
def show
- @status_options = @issue.status.workflows.find(:all, :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user\r
+ @status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user\r
@custom_values = @issue.custom_values.find(:all, :include => :custom_field)\r
@journals_count = @issue.journals.count\r
@journals = @issue.journals.find(:all, :include => [:user, :details], :limit => 15, :order => "journals.created_on desc")\r
\r
def change_status\r
#@history = @issue.histories.build(params[:history]) \r
- @status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user\r
+ @status_options = @issue.status.workflows.find(:all, :order => 'position', :include => :new_status, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user\r
@new_status = IssueStatus.find(params[:new_status_id])\r
if params[:confirm]\r
begin\r
before_filter :find_project, :authorize\r
\r
def issue_report\r
- @statuses = IssueStatus.find :all\r
+ @statuses = IssueStatus.find(:all, :order => 'position')\r
\r
case params[:detail]\r
when "tracker"\r
end\r
@roles = Role.find :all\r
@trackers = Tracker.find :all\r
- @statuses = IssueStatus.find(:all, :include => :workflows)\r
+ @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')\r
end
end
class IssueStatus < ActiveRecord::Base\r
before_destroy :check_integrity \r
has_many :workflows, :foreign_key => "old_status_id"\r
+ acts_as_list\r
\r
validates_presence_of :name\r
validates_uniqueness_of :name\r
def available_filters
return @available_filters if @available_filters
- @available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all).collect{|s| [s.name, s.id.to_s] } },
+ @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] } },
"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 },
<th><%=l(:field_status)%></th>\r
<th><%=l(:field_is_default)%></th>\r
<th><%=l(:field_is_closed)%></th>\r
+ <th><%=l(:button_sort)%></th>
<th></th>
</tr></thead>
<tbody>
<td><div class="square" style="background:#<%= status.html_color %>;"></div> <%= link_to status.name, :action => 'edit', :id => status %></td>\r
<td align="center"><%= image_tag 'true.png' if status.is_default? %></td>\r
<td align="center"><%= image_tag 'true.png' if status.is_closed? %></td>\r
+ <td align="center">
+ <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => status, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
+ <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => status, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
+ <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => status, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
+ <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => status, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
+ </td>
<td align="center">
<%= button_to l(:button_delete), { :action => 'destroy', :id => status }, :confirm => l(:text_are_you_sure), :class => "button-small" %>\r
</td>
--- /dev/null
+class AddIssueStatusPosition < ActiveRecord::Migration
+ def self.up
+ add_column :issue_statuses, :position, :integer, :default => 1, :null => false
+ IssueStatus.find(:all).each_with_index {|status, i| status.update_attribute(:position, i+1)}
+ end
+
+ def self.down
+ remove_column :issue_statuses, :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 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
label_view_revisions: Die Neuausgaben ansehen\r
label_max_size: Maximale Größe\r
label_on: auf\r
+label_sort_highest: Erste\r
+label_sort_higher: Aufzurichten\r
+label_sort_lower: Herabzusteigen\r
+label_sort_lowest: Letzter\r
\r
button_login: Einloggen\r
button_submit: Einreichen\r
button_back: Rückkehr\r
button_cancel: Annullieren\r
button_activate: Aktivieren\r
+button_sort: Sortieren\r
\r
text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
label_view_revisions: View revisions\r
label_max_size: Maximum size\r
label_on: 'on'\r
+label_sort_highest: Move to top\r
+label_sort_higher: Move up\r
+label_sort_lower: Move down\r
+label_sort_lowest: Move to bottom\r
\r
button_login: Login\r
button_submit: Submit\r
button_back: Back\r
button_cancel: Cancel\r
button_activate: Activate\r
+button_sort: Sort\r
\r
text_select_mail_notifications: Select actions for which mail notifications should be sent.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
label_view_revisions: Ver las revisiones\r
label_max_size: Tamaño máximo\r
label_on: en\r
+label_sort_highest: Primero\r
+label_sort_higher: Subir\r
+label_sort_lower: Bajar\r
+label_sort_lowest: Último\r
\r
button_login: Conexión\r
button_submit: Someter\r
button_back: Atrás\r
button_cancel: Cancelar\r
button_activate: Activar\r
+button_sort: Clasificar\r
\r
text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.\r
text_regexp_info: eg. ^[A-Z0-9]+$\r
label_view_revisions: Voir les révisions\r
label_max_size: Taille maximale\r
label_on: sur\r
+label_sort_highest: Remonter en premier\r
+label_sort_higher: Remonter\r
+label_sort_lower: Descendre\r
+label_sort_lowest: Descendre en dernier\r
\r
button_login: Connexion\r
button_submit: Soumettre\r
button_back: Retour\r
button_cancel: Annuler\r
button_activate: Activer\r
+button_sort: Trier\r
\r
text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.\r
text_regexp_info: ex. ^[A-Z0-9]+$\r