##// END OF EJS Templates
Default status per tracker (#5991)....
Jean-Philippe Lang -
r13153:dfc594c33702
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -0,0 +1,15
1 class AddTrackersDefaultStatusId < ActiveRecord::Migration
2 def up
3 add_column :trackers, :default_status_id, :integer
4
5 status_id = IssueStatus.where(:is_default => true).pluck(:id).first
6 status_id ||= IssueStatus.order(:position).pluck(:id).first
7 if status_id
8 Tracker.update_all :default_status_id => status_id
9 end
10 end
11
12 def down
13 remove_column :trackers, :default_status_id
14 end
15 end
@@ -0,0 +1,12
1 class RemoveIssueStatusesIsDefault < ActiveRecord::Migration
2 def up
3 remove_column :issue_statuses, :is_default
4 end
5
6 def down
7 add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false
8 # Restores the first status as default
9 default_status_id = IssueStatus.order("position").first.pluck(:id)
10 IssueStatus.where(:id => default_status_id).update_all(:is_default => true)
11 end
12 end
@@ -1,487 +1,489
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class IssuesController < ApplicationController
18 class IssuesController < ApplicationController
19 menu_item :new_issue, :only => [:new, :create]
19 menu_item :new_issue, :only => [:new, :create]
20 default_search_scope :issues
20 default_search_scope :issues
21
21
22 before_filter :find_issue, :only => [:show, :edit, :update]
22 before_filter :find_issue, :only => [:show, :edit, :update]
23 before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
23 before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
24 before_filter :find_project, :only => [:new, :create, :update_form]
24 before_filter :find_project, :only => [:new, :create, :update_form]
25 before_filter :authorize, :except => [:index]
25 before_filter :authorize, :except => [:index]
26 before_filter :find_optional_project, :only => [:index]
26 before_filter :find_optional_project, :only => [:index]
27 before_filter :check_for_default_issue_status, :only => [:new, :create]
28 before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form]
27 before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form]
29 accept_rss_auth :index, :show
28 accept_rss_auth :index, :show
30 accept_api_auth :index, :show, :create, :update, :destroy
29 accept_api_auth :index, :show, :create, :update, :destroy
31
30
32 rescue_from Query::StatementInvalid, :with => :query_statement_invalid
31 rescue_from Query::StatementInvalid, :with => :query_statement_invalid
33
32
34 helper :journals
33 helper :journals
35 helper :projects
34 helper :projects
36 include ProjectsHelper
35 include ProjectsHelper
37 helper :custom_fields
36 helper :custom_fields
38 include CustomFieldsHelper
37 include CustomFieldsHelper
39 helper :issue_relations
38 helper :issue_relations
40 include IssueRelationsHelper
39 include IssueRelationsHelper
41 helper :watchers
40 helper :watchers
42 include WatchersHelper
41 include WatchersHelper
43 helper :attachments
42 helper :attachments
44 include AttachmentsHelper
43 include AttachmentsHelper
45 helper :queries
44 helper :queries
46 include QueriesHelper
45 include QueriesHelper
47 helper :repositories
46 helper :repositories
48 include RepositoriesHelper
47 include RepositoriesHelper
49 helper :sort
48 helper :sort
50 include SortHelper
49 include SortHelper
51 include IssuesHelper
50 include IssuesHelper
52 helper :timelog
51 helper :timelog
53 include Redmine::Export::PDF
52 include Redmine::Export::PDF
54
53
55 def index
54 def index
56 retrieve_query
55 retrieve_query
57 sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
56 sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
58 sort_update(@query.sortable_columns)
57 sort_update(@query.sortable_columns)
59 @query.sort_criteria = sort_criteria.to_a
58 @query.sort_criteria = sort_criteria.to_a
60
59
61 if @query.valid?
60 if @query.valid?
62 case params[:format]
61 case params[:format]
63 when 'csv', 'pdf'
62 when 'csv', 'pdf'
64 @limit = Setting.issues_export_limit.to_i
63 @limit = Setting.issues_export_limit.to_i
65 if params[:columns] == 'all'
64 if params[:columns] == 'all'
66 @query.column_names = @query.available_inline_columns.map(&:name)
65 @query.column_names = @query.available_inline_columns.map(&:name)
67 end
66 end
68 when 'atom'
67 when 'atom'
69 @limit = Setting.feeds_limit.to_i
68 @limit = Setting.feeds_limit.to_i
70 when 'xml', 'json'
69 when 'xml', 'json'
71 @offset, @limit = api_offset_and_limit
70 @offset, @limit = api_offset_and_limit
72 @query.column_names = %w(author)
71 @query.column_names = %w(author)
73 else
72 else
74 @limit = per_page_option
73 @limit = per_page_option
75 end
74 end
76
75
77 @issue_count = @query.issue_count
76 @issue_count = @query.issue_count
78 @issue_pages = Paginator.new @issue_count, @limit, params['page']
77 @issue_pages = Paginator.new @issue_count, @limit, params['page']
79 @offset ||= @issue_pages.offset
78 @offset ||= @issue_pages.offset
80 @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
79 @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
81 :order => sort_clause,
80 :order => sort_clause,
82 :offset => @offset,
81 :offset => @offset,
83 :limit => @limit)
82 :limit => @limit)
84 @issue_count_by_group = @query.issue_count_by_group
83 @issue_count_by_group = @query.issue_count_by_group
85
84
86 respond_to do |format|
85 respond_to do |format|
87 format.html { render :template => 'issues/index', :layout => !request.xhr? }
86 format.html { render :template => 'issues/index', :layout => !request.xhr? }
88 format.api {
87 format.api {
89 Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
88 Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
90 }
89 }
91 format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
90 format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
92 format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
91 format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
93 format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
92 format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
94 end
93 end
95 else
94 else
96 respond_to do |format|
95 respond_to do |format|
97 format.html { render(:template => 'issues/index', :layout => !request.xhr?) }
96 format.html { render(:template => 'issues/index', :layout => !request.xhr?) }
98 format.any(:atom, :csv, :pdf) { render(:nothing => true) }
97 format.any(:atom, :csv, :pdf) { render(:nothing => true) }
99 format.api { render_validation_errors(@query) }
98 format.api { render_validation_errors(@query) }
100 end
99 end
101 end
100 end
102 rescue ActiveRecord::RecordNotFound
101 rescue ActiveRecord::RecordNotFound
103 render_404
102 render_404
104 end
103 end
105
104
106 def show
105 def show
107 @journals = @issue.journals.includes(:user, :details).
106 @journals = @issue.journals.includes(:user, :details).
108 references(:user, :details).
107 references(:user, :details).
109 reorder("#{Journal.table_name}.id ASC").to_a
108 reorder("#{Journal.table_name}.id ASC").to_a
110 @journals.each_with_index {|j,i| j.indice = i+1}
109 @journals.each_with_index {|j,i| j.indice = i+1}
111 @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
110 @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
112 Journal.preload_journals_details_custom_fields(@journals)
111 Journal.preload_journals_details_custom_fields(@journals)
113 @journals.select! {|journal| journal.notes? || journal.visible_details.any?}
112 @journals.select! {|journal| journal.notes? || journal.visible_details.any?}
114 @journals.reverse! if User.current.wants_comments_in_reverse_order?
113 @journals.reverse! if User.current.wants_comments_in_reverse_order?
115
114
116 @changesets = @issue.changesets.visible.to_a
115 @changesets = @issue.changesets.visible.to_a
117 @changesets.reverse! if User.current.wants_comments_in_reverse_order?
116 @changesets.reverse! if User.current.wants_comments_in_reverse_order?
118
117
119 @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
118 @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
120 @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
119 @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
121 @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
120 @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
122 @priorities = IssuePriority.active
121 @priorities = IssuePriority.active
123 @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
122 @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
124 @relation = IssueRelation.new
123 @relation = IssueRelation.new
125
124
126 respond_to do |format|
125 respond_to do |format|
127 format.html {
126 format.html {
128 retrieve_previous_and_next_issue_ids
127 retrieve_previous_and_next_issue_ids
129 render :template => 'issues/show'
128 render :template => 'issues/show'
130 }
129 }
131 format.api
130 format.api
132 format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
131 format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
133 format.pdf {
132 format.pdf {
134 pdf = issue_to_pdf(@issue, :journals => @journals)
133 pdf = issue_to_pdf(@issue, :journals => @journals)
135 send_data(pdf, :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf")
134 send_data(pdf, :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf")
136 }
135 }
137 end
136 end
138 end
137 end
139
138
140 # Add a new issue
139 # Add a new issue
141 # The new issue will be created from an existing one if copy_from parameter is given
140 # The new issue will be created from an existing one if copy_from parameter is given
142 def new
141 def new
143 respond_to do |format|
142 respond_to do |format|
144 format.html { render :action => 'new', :layout => !request.xhr? }
143 format.html { render :action => 'new', :layout => !request.xhr? }
145 end
144 end
146 end
145 end
147
146
148 def create
147 def create
149 call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
148 call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
150 @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
149 @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
151 if @issue.save
150 if @issue.save
152 call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
151 call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
153 respond_to do |format|
152 respond_to do |format|
154 format.html {
153 format.html {
155 render_attachment_warning_if_needed(@issue)
154 render_attachment_warning_if_needed(@issue)
156 flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
155 flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
157 if params[:continue]
156 if params[:continue]
158 attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
157 attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
159 redirect_to new_project_issue_path(@issue.project, :issue => attrs)
158 redirect_to new_project_issue_path(@issue.project, :issue => attrs)
160 else
159 else
161 redirect_to issue_path(@issue)
160 redirect_to issue_path(@issue)
162 end
161 end
163 }
162 }
164 format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
163 format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
165 end
164 end
166 return
165 return
167 else
166 else
168 respond_to do |format|
167 respond_to do |format|
169 format.html { render :action => 'new' }
168 format.html { render :action => 'new' }
170 format.api { render_validation_errors(@issue) }
169 format.api { render_validation_errors(@issue) }
171 end
170 end
172 end
171 end
173 end
172 end
174
173
175 def edit
174 def edit
176 return unless update_issue_from_params
175 return unless update_issue_from_params
177
176
178 respond_to do |format|
177 respond_to do |format|
179 format.html { }
178 format.html { }
180 format.xml { }
179 format.xml { }
181 end
180 end
182 end
181 end
183
182
184 def update
183 def update
185 return unless update_issue_from_params
184 return unless update_issue_from_params
186 @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
185 @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
187 saved = false
186 saved = false
188 begin
187 begin
189 saved = save_issue_with_child_records
188 saved = save_issue_with_child_records
190 rescue ActiveRecord::StaleObjectError
189 rescue ActiveRecord::StaleObjectError
191 @conflict = true
190 @conflict = true
192 if params[:last_journal_id]
191 if params[:last_journal_id]
193 @conflict_journals = @issue.journals_after(params[:last_journal_id]).to_a
192 @conflict_journals = @issue.journals_after(params[:last_journal_id]).to_a
194 @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
193 @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
195 end
194 end
196 end
195 end
197
196
198 if saved
197 if saved
199 render_attachment_warning_if_needed(@issue)
198 render_attachment_warning_if_needed(@issue)
200 flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
199 flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
201
200
202 respond_to do |format|
201 respond_to do |format|
203 format.html { redirect_back_or_default issue_path(@issue) }
202 format.html { redirect_back_or_default issue_path(@issue) }
204 format.api { render_api_ok }
203 format.api { render_api_ok }
205 end
204 end
206 else
205 else
207 respond_to do |format|
206 respond_to do |format|
208 format.html { render :action => 'edit' }
207 format.html { render :action => 'edit' }
209 format.api { render_validation_errors(@issue) }
208 format.api { render_validation_errors(@issue) }
210 end
209 end
211 end
210 end
212 end
211 end
213
212
214 # Updates the issue form when changing the project, status or tracker
213 # Updates the issue form when changing the project, status or tracker
215 # on issue creation/update
214 # on issue creation/update
216 def update_form
215 def update_form
217 end
216 end
218
217
219 # Bulk edit/copy a set of issues
218 # Bulk edit/copy a set of issues
220 def bulk_edit
219 def bulk_edit
221 @issues.sort!
220 @issues.sort!
222 @copy = params[:copy].present?
221 @copy = params[:copy].present?
223 @notes = params[:notes]
222 @notes = params[:notes]
224
223
225 if User.current.allowed_to?(:move_issues, @projects)
224 if User.current.allowed_to?(:move_issues, @projects)
226 @allowed_projects = Issue.allowed_target_projects_on_move
225 @allowed_projects = Issue.allowed_target_projects_on_move
227 if params[:issue]
226 if params[:issue]
228 @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id].to_s}
227 @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id].to_s}
229 if @target_project
228 if @target_project
230 target_projects = [@target_project]
229 target_projects = [@target_project]
231 end
230 end
232 end
231 end
233 end
232 end
234 target_projects ||= @projects
233 target_projects ||= @projects
235
234
236 if @copy
235 if @copy
237 @available_statuses = [IssueStatus.default]
236 # Copied issues will get their default statuses
237 @available_statuses = []
238 else
238 else
239 @available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&)
239 @available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&)
240 end
240 end
241 @custom_fields = target_projects.map{|p|p.all_issue_custom_fields.visible}.reduce(:&)
241 @custom_fields = target_projects.map{|p|p.all_issue_custom_fields.visible}.reduce(:&)
242 @assignables = target_projects.map(&:assignable_users).reduce(:&)
242 @assignables = target_projects.map(&:assignable_users).reduce(:&)
243 @trackers = target_projects.map(&:trackers).reduce(:&)
243 @trackers = target_projects.map(&:trackers).reduce(:&)
244 @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
244 @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
245 @categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
245 @categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
246 if @copy
246 if @copy
247 @attachments_present = @issues.detect {|i| i.attachments.any?}.present?
247 @attachments_present = @issues.detect {|i| i.attachments.any?}.present?
248 @subtasks_present = @issues.detect {|i| !i.leaf?}.present?
248 @subtasks_present = @issues.detect {|i| !i.leaf?}.present?
249 end
249 end
250
250
251 @safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&)
251 @safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&)
252
252
253 @issue_params = params[:issue] || {}
253 @issue_params = params[:issue] || {}
254 @issue_params[:custom_field_values] ||= {}
254 @issue_params[:custom_field_values] ||= {}
255 end
255 end
256
256
257 def bulk_update
257 def bulk_update
258 @issues.sort!
258 @issues.sort!
259 @copy = params[:copy].present?
259 @copy = params[:copy].present?
260 attributes = parse_params_for_bulk_issue_attributes(params)
260 attributes = parse_params_for_bulk_issue_attributes(params)
261
261
262 unsaved_issues = []
262 unsaved_issues = []
263 saved_issues = []
263 saved_issues = []
264
264
265 if @copy && params[:copy_subtasks].present?
265 if @copy && params[:copy_subtasks].present?
266 # Descendant issues will be copied with the parent task
266 # Descendant issues will be copied with the parent task
267 # Don't copy them twice
267 # Don't copy them twice
268 @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
268 @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
269 end
269 end
270
270
271 @issues.each do |orig_issue|
271 @issues.each do |orig_issue|
272 orig_issue.reload
272 orig_issue.reload
273 if @copy
273 if @copy
274 issue = orig_issue.copy({},
274 issue = orig_issue.copy({},
275 :attachments => params[:copy_attachments].present?,
275 :attachments => params[:copy_attachments].present?,
276 :subtasks => params[:copy_subtasks].present?
276 :subtasks => params[:copy_subtasks].present?
277 )
277 )
278 else
278 else
279 issue = orig_issue
279 issue = orig_issue
280 end
280 end
281 journal = issue.init_journal(User.current, params[:notes])
281 journal = issue.init_journal(User.current, params[:notes])
282 issue.safe_attributes = attributes
282 issue.safe_attributes = attributes
283 call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
283 call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
284 if issue.save
284 if issue.save
285 saved_issues << issue
285 saved_issues << issue
286 else
286 else
287 unsaved_issues << orig_issue
287 unsaved_issues << orig_issue
288 end
288 end
289 end
289 end
290
290
291 if unsaved_issues.empty?
291 if unsaved_issues.empty?
292 flash[:notice] = l(:notice_successful_update) unless saved_issues.empty?
292 flash[:notice] = l(:notice_successful_update) unless saved_issues.empty?
293 if params[:follow]
293 if params[:follow]
294 if @issues.size == 1 && saved_issues.size == 1
294 if @issues.size == 1 && saved_issues.size == 1
295 redirect_to issue_path(saved_issues.first)
295 redirect_to issue_path(saved_issues.first)
296 elsif saved_issues.map(&:project).uniq.size == 1
296 elsif saved_issues.map(&:project).uniq.size == 1
297 redirect_to project_issues_path(saved_issues.map(&:project).first)
297 redirect_to project_issues_path(saved_issues.map(&:project).first)
298 end
298 end
299 else
299 else
300 redirect_back_or_default _project_issues_path(@project)
300 redirect_back_or_default _project_issues_path(@project)
301 end
301 end
302 else
302 else
303 @saved_issues = @issues
303 @saved_issues = @issues
304 @unsaved_issues = unsaved_issues
304 @unsaved_issues = unsaved_issues
305 @issues = Issue.visible.where(:id => @unsaved_issues.map(&:id)).to_a
305 @issues = Issue.visible.where(:id => @unsaved_issues.map(&:id)).to_a
306 bulk_edit
306 bulk_edit
307 render :action => 'bulk_edit'
307 render :action => 'bulk_edit'
308 end
308 end
309 end
309 end
310
310
311 def destroy
311 def destroy
312 @hours = TimeEntry.where(:issue_id => @issues.map(&:id)).sum(:hours).to_f
312 @hours = TimeEntry.where(:issue_id => @issues.map(&:id)).sum(:hours).to_f
313 if @hours > 0
313 if @hours > 0
314 case params[:todo]
314 case params[:todo]
315 when 'destroy'
315 when 'destroy'
316 # nothing to do
316 # nothing to do
317 when 'nullify'
317 when 'nullify'
318 TimeEntry.where(['issue_id IN (?)', @issues]).update_all('issue_id = NULL')
318 TimeEntry.where(['issue_id IN (?)', @issues]).update_all('issue_id = NULL')
319 when 'reassign'
319 when 'reassign'
320 reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
320 reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
321 if reassign_to.nil?
321 if reassign_to.nil?
322 flash.now[:error] = l(:error_issue_not_found_in_project)
322 flash.now[:error] = l(:error_issue_not_found_in_project)
323 return
323 return
324 else
324 else
325 TimeEntry.where(['issue_id IN (?)', @issues]).
325 TimeEntry.where(['issue_id IN (?)', @issues]).
326 update_all("issue_id = #{reassign_to.id}")
326 update_all("issue_id = #{reassign_to.id}")
327 end
327 end
328 else
328 else
329 # display the destroy form if it's a user request
329 # display the destroy form if it's a user request
330 return unless api_request?
330 return unless api_request?
331 end
331 end
332 end
332 end
333 @issues.each do |issue|
333 @issues.each do |issue|
334 begin
334 begin
335 issue.reload.destroy
335 issue.reload.destroy
336 rescue ::ActiveRecord::RecordNotFound # raised by #reload if issue no longer exists
336 rescue ::ActiveRecord::RecordNotFound # raised by #reload if issue no longer exists
337 # nothing to do, issue was already deleted (eg. by a parent)
337 # nothing to do, issue was already deleted (eg. by a parent)
338 end
338 end
339 end
339 end
340 respond_to do |format|
340 respond_to do |format|
341 format.html { redirect_back_or_default _project_issues_path(@project) }
341 format.html { redirect_back_or_default _project_issues_path(@project) }
342 format.api { render_api_ok }
342 format.api { render_api_ok }
343 end
343 end
344 end
344 end
345
345
346 private
346 private
347
347
348 def find_project
348 def find_project
349 project_id = params[:project_id] || (params[:issue] && params[:issue][:project_id])
349 project_id = params[:project_id] || (params[:issue] && params[:issue][:project_id])
350 @project = Project.find(project_id)
350 @project = Project.find(project_id)
351 rescue ActiveRecord::RecordNotFound
351 rescue ActiveRecord::RecordNotFound
352 render_404
352 render_404
353 end
353 end
354
354
355 def retrieve_previous_and_next_issue_ids
355 def retrieve_previous_and_next_issue_ids
356 retrieve_query_from_session
356 retrieve_query_from_session
357 if @query
357 if @query
358 sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
358 sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
359 sort_update(@query.sortable_columns, 'issues_index_sort')
359 sort_update(@query.sortable_columns, 'issues_index_sort')
360 limit = 500
360 limit = 500
361 issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version])
361 issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version])
362 if (idx = issue_ids.index(@issue.id)) && idx < limit
362 if (idx = issue_ids.index(@issue.id)) && idx < limit
363 if issue_ids.size < 500
363 if issue_ids.size < 500
364 @issue_position = idx + 1
364 @issue_position = idx + 1
365 @issue_count = issue_ids.size
365 @issue_count = issue_ids.size
366 end
366 end
367 @prev_issue_id = issue_ids[idx - 1] if idx > 0
367 @prev_issue_id = issue_ids[idx - 1] if idx > 0
368 @next_issue_id = issue_ids[idx + 1] if idx < (issue_ids.size - 1)
368 @next_issue_id = issue_ids[idx + 1] if idx < (issue_ids.size - 1)
369 end
369 end
370 end
370 end
371 end
371 end
372
372
373 # Used by #edit and #update to set some common instance variables
373 # Used by #edit and #update to set some common instance variables
374 # from the params
374 # from the params
375 # TODO: Refactor, not everything in here is needed by #edit
375 # TODO: Refactor, not everything in here is needed by #edit
376 def update_issue_from_params
376 def update_issue_from_params
377 @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
377 @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
378 @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
378 @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
379 if params[:time_entry]
379 if params[:time_entry]
380 @time_entry.attributes = params[:time_entry]
380 @time_entry.attributes = params[:time_entry]
381 end
381 end
382
382
383 @issue.init_journal(User.current)
383 @issue.init_journal(User.current)
384
384
385 issue_attributes = params[:issue]
385 issue_attributes = params[:issue]
386 if issue_attributes && params[:conflict_resolution]
386 if issue_attributes && params[:conflict_resolution]
387 case params[:conflict_resolution]
387 case params[:conflict_resolution]
388 when 'overwrite'
388 when 'overwrite'
389 issue_attributes = issue_attributes.dup
389 issue_attributes = issue_attributes.dup
390 issue_attributes.delete(:lock_version)
390 issue_attributes.delete(:lock_version)
391 when 'add_notes'
391 when 'add_notes'
392 issue_attributes = issue_attributes.slice(:notes)
392 issue_attributes = issue_attributes.slice(:notes)
393 when 'cancel'
393 when 'cancel'
394 redirect_to issue_path(@issue)
394 redirect_to issue_path(@issue)
395 return false
395 return false
396 end
396 end
397 end
397 end
398 @issue.safe_attributes = issue_attributes
398 @issue.safe_attributes = issue_attributes
399 @priorities = IssuePriority.active
399 @priorities = IssuePriority.active
400 @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
400 @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
401 true
401 true
402 end
402 end
403
403
404 # TODO: Refactor, lots of extra code in here
404 # TODO: Refactor, lots of extra code in here
405 # TODO: Changing tracker on an existing issue should not trigger this
405 # TODO: Changing tracker on an existing issue should not trigger this
406 def build_new_issue_from_params
406 def build_new_issue_from_params
407 if params[:id].blank?
407 if params[:id].blank?
408 @issue = Issue.new
408 @issue = Issue.new
409 @issue.init_journal(User.current)
409 @issue.init_journal(User.current)
410 if params[:copy_from]
410 if params[:copy_from]
411 begin
411 begin
412 @copy_from = Issue.visible.find(params[:copy_from])
412 @copy_from = Issue.visible.find(params[:copy_from])
413 @copy_attachments = params[:copy_attachments].present? || request.get?
413 @copy_attachments = params[:copy_attachments].present? || request.get?
414 @copy_subtasks = params[:copy_subtasks].present? || request.get?
414 @copy_subtasks = params[:copy_subtasks].present? || request.get?
415 @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks)
415 @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks)
416 rescue ActiveRecord::RecordNotFound
416 rescue ActiveRecord::RecordNotFound
417 render_404
417 render_404
418 return
418 return
419 end
419 end
420 end
420 end
421 @issue.project = @project
421 @issue.project = @project
422 @issue.author ||= User.current
422 @issue.author ||= User.current
423 @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?
423 @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?
424 else
424 else
425 @issue = @project.issues.visible.find(params[:id])
425 @issue = @project.issues.visible.find(params[:id])
426 end
426 end
427
427
428 @issue.safe_attributes = params[:issue]
428 if attrs = params[:issue].deep_dup
429 if params[:was_default_status] == attrs[:status_id]
430 attrs.delete(:status_id)
431 end
432 @issue.safe_attributes = attrs
433 end
429 @issue.tracker ||= @project.trackers.first
434 @issue.tracker ||= @project.trackers.first
430 if @issue.tracker.nil?
435 if @issue.tracker.nil?
431 render_error l(:error_no_tracker_in_project)
436 render_error l(:error_no_tracker_in_project)
432 return false
437 return false
433 end
438 end
439 if @issue.status.nil?
440 render_error l(:error_no_default_issue_status)
441 return false
442 end
434
443
435 @priorities = IssuePriority.active
444 @priorities = IssuePriority.active
436 @allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?)
445 @allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?)
437 @available_watchers = @issue.watcher_users
446 @available_watchers = @issue.watcher_users
438 if @issue.project.users.count <= 20
447 if @issue.project.users.count <= 20
439 @available_watchers = (@available_watchers + @issue.project.users.sort).uniq
448 @available_watchers = (@available_watchers + @issue.project.users.sort).uniq
440 end
449 end
441 end
450 end
442
451
443 def check_for_default_issue_status
444 if IssueStatus.default.nil?
445 render_error l(:error_no_default_issue_status)
446 return false
447 end
448 end
449
450 def parse_params_for_bulk_issue_attributes(params)
452 def parse_params_for_bulk_issue_attributes(params)
451 attributes = (params[:issue] || {}).reject {|k,v| v.blank?}
453 attributes = (params[:issue] || {}).reject {|k,v| v.blank?}
452 attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'}
454 attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'}
453 if custom = attributes[:custom_field_values]
455 if custom = attributes[:custom_field_values]
454 custom.reject! {|k,v| v.blank?}
456 custom.reject! {|k,v| v.blank?}
455 custom.keys.each do |k|
457 custom.keys.each do |k|
456 if custom[k].is_a?(Array)
458 if custom[k].is_a?(Array)
457 custom[k] << '' if custom[k].delete('__none__')
459 custom[k] << '' if custom[k].delete('__none__')
458 else
460 else
459 custom[k] = '' if custom[k] == '__none__'
461 custom[k] = '' if custom[k] == '__none__'
460 end
462 end
461 end
463 end
462 end
464 end
463 attributes
465 attributes
464 end
466 end
465
467
466 # Saves @issue and a time_entry from the parameters
468 # Saves @issue and a time_entry from the parameters
467 def save_issue_with_child_records
469 def save_issue_with_child_records
468 Issue.transaction do
470 Issue.transaction do
469 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, @issue.project)
471 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, @issue.project)
470 time_entry = @time_entry || TimeEntry.new
472 time_entry = @time_entry || TimeEntry.new
471 time_entry.project = @issue.project
473 time_entry.project = @issue.project
472 time_entry.issue = @issue
474 time_entry.issue = @issue
473 time_entry.user = User.current
475 time_entry.user = User.current
474 time_entry.spent_on = User.current.today
476 time_entry.spent_on = User.current.today
475 time_entry.attributes = params[:time_entry]
477 time_entry.attributes = params[:time_entry]
476 @issue.time_entries << time_entry
478 @issue.time_entries << time_entry
477 end
479 end
478
480
479 call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
481 call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
480 if @issue.save
482 if @issue.save
481 call_hook(:controller_issues_edit_after_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
483 call_hook(:controller_issues_edit_after_save, { :params => params, :issue => @issue, :time_entry => time_entry, :journal => @issue.current_journal})
482 else
484 else
483 raise ActiveRecord::Rollback
485 raise ActiveRecord::Rollback
484 end
486 end
485 end
487 end
486 end
488 end
487 end
489 end
@@ -1,1640 +1,1683
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Issue < ActiveRecord::Base
18 class Issue < ActiveRecord::Base
19 include Redmine::SafeAttributes
19 include Redmine::SafeAttributes
20 include Redmine::Utils::DateCalculation
20 include Redmine::Utils::DateCalculation
21 include Redmine::I18n
21 include Redmine::I18n
22
22
23 belongs_to :project
23 belongs_to :project
24 belongs_to :tracker
24 belongs_to :tracker
25 belongs_to :status, :class_name => 'IssueStatus'
25 belongs_to :status, :class_name => 'IssueStatus'
26 belongs_to :author, :class_name => 'User'
26 belongs_to :author, :class_name => 'User'
27 belongs_to :assigned_to, :class_name => 'Principal'
27 belongs_to :assigned_to, :class_name => 'Principal'
28 belongs_to :fixed_version, :class_name => 'Version'
28 belongs_to :fixed_version, :class_name => 'Version'
29 belongs_to :priority, :class_name => 'IssuePriority'
29 belongs_to :priority, :class_name => 'IssuePriority'
30 belongs_to :category, :class_name => 'IssueCategory'
30 belongs_to :category, :class_name => 'IssueCategory'
31
31
32 has_many :journals, :as => :journalized, :dependent => :destroy
32 has_many :journals, :as => :journalized, :dependent => :destroy
33 has_many :visible_journals,
33 has_many :visible_journals,
34 lambda {where(["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false])},
34 lambda {where(["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false])},
35 :class_name => 'Journal',
35 :class_name => 'Journal',
36 :as => :journalized
36 :as => :journalized
37
37
38 has_many :time_entries, :dependent => :destroy
38 has_many :time_entries, :dependent => :destroy
39 has_and_belongs_to_many :changesets, lambda {order("#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC")}
39 has_and_belongs_to_many :changesets, lambda {order("#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC")}
40
40
41 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
41 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
42 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
42 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
43
43
44 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
44 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
45 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
45 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
46 acts_as_customizable
46 acts_as_customizable
47 acts_as_watchable
47 acts_as_watchable
48 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
48 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
49 # sort by id so that limited eager loading doesn't break with postgresql
49 # sort by id so that limited eager loading doesn't break with postgresql
50 :order_column => "#{table_name}.id",
50 :order_column => "#{table_name}.id",
51 :scope => lambda { joins(:project).
51 :scope => lambda { joins(:project).
52 joins("LEFT OUTER JOIN #{Journal.table_name} ON #{Journal.table_name}.journalized_type='Issue'" +
52 joins("LEFT OUTER JOIN #{Journal.table_name} ON #{Journal.table_name}.journalized_type='Issue'" +
53 " AND #{Journal.table_name}.journalized_id = #{Issue.table_name}.id" +
53 " AND #{Journal.table_name}.journalized_id = #{Issue.table_name}.id" +
54 " AND (#{Journal.table_name}.private_notes = #{connection.quoted_false}" +
54 " AND (#{Journal.table_name}.private_notes = #{connection.quoted_false}" +
55 " OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))") }
55 " OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))") }
56
56
57 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
57 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
58 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
58 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
59 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
59 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
60
60
61 acts_as_activity_provider :scope => preload(:project, :author, :tracker),
61 acts_as_activity_provider :scope => preload(:project, :author, :tracker),
62 :author_key => :author_id
62 :author_key => :author_id
63
63
64 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
64 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
65
65
66 attr_reader :current_journal
66 attr_reader :current_journal
67 delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
67 delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
68
68
69 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
69 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
70
70
71 validates_length_of :subject, :maximum => 255
71 validates_length_of :subject, :maximum => 255
72 validates_inclusion_of :done_ratio, :in => 0..100
72 validates_inclusion_of :done_ratio, :in => 0..100
73 validates :estimated_hours, :numericality => {:greater_than_or_equal_to => 0, :allow_nil => true, :message => :invalid}
73 validates :estimated_hours, :numericality => {:greater_than_or_equal_to => 0, :allow_nil => true, :message => :invalid}
74 validates :start_date, :date => true
74 validates :start_date, :date => true
75 validates :due_date, :date => true
75 validates :due_date, :date => true
76 validate :validate_issue, :validate_required_fields
76 validate :validate_issue, :validate_required_fields
77 attr_protected :id
77 attr_protected :id
78
78
79 scope :visible, lambda {|*args|
79 scope :visible, lambda {|*args|
80 includes(:project).
80 includes(:project).
81 references(:project).
81 references(:project).
82 where(Issue.visible_condition(args.shift || User.current, *args))
82 where(Issue.visible_condition(args.shift || User.current, *args))
83 }
83 }
84
84
85 scope :open, lambda {|*args|
85 scope :open, lambda {|*args|
86 is_closed = args.size > 0 ? !args.first : false
86 is_closed = args.size > 0 ? !args.first : false
87 joins(:status).
87 joins(:status).
88 where("#{IssueStatus.table_name}.is_closed = ?", is_closed)
88 where("#{IssueStatus.table_name}.is_closed = ?", is_closed)
89 }
89 }
90
90
91 scope :recently_updated, lambda { order("#{Issue.table_name}.updated_on DESC") }
91 scope :recently_updated, lambda { order("#{Issue.table_name}.updated_on DESC") }
92 scope :on_active_project, lambda {
92 scope :on_active_project, lambda {
93 joins(:project).
93 joins(:project).
94 where("#{Project.table_name}.status = ?", Project::STATUS_ACTIVE)
94 where("#{Project.table_name}.status = ?", Project::STATUS_ACTIVE)
95 }
95 }
96 scope :fixed_version, lambda {|versions|
96 scope :fixed_version, lambda {|versions|
97 ids = [versions].flatten.compact.map {|v| v.is_a?(Version) ? v.id : v}
97 ids = [versions].flatten.compact.map {|v| v.is_a?(Version) ? v.id : v}
98 ids.any? ? where(:fixed_version_id => ids) : where('1=0')
98 ids.any? ? where(:fixed_version_id => ids) : where('1=0')
99 }
99 }
100
100
101 before_create :default_assign
101 before_create :default_assign
102 before_save :close_duplicates, :update_done_ratio_from_issue_status,
102 before_save :close_duplicates, :update_done_ratio_from_issue_status,
103 :force_updated_on_change, :update_closed_on, :set_assigned_to_was
103 :force_updated_on_change, :update_closed_on, :set_assigned_to_was
104 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
104 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
105 after_save :reschedule_following_issues, :update_nested_set_attributes,
105 after_save :reschedule_following_issues, :update_nested_set_attributes,
106 :update_parent_attributes, :create_journal
106 :update_parent_attributes, :create_journal
107 # Should be after_create but would be called before previous after_save callbacks
107 # Should be after_create but would be called before previous after_save callbacks
108 after_save :after_create_from_copy
108 after_save :after_create_from_copy
109 after_destroy :update_parent_attributes
109 after_destroy :update_parent_attributes
110 after_create :send_notification
110 after_create :send_notification
111 # Keep it at the end of after_save callbacks
111 # Keep it at the end of after_save callbacks
112 after_save :clear_assigned_to_was
112 after_save :clear_assigned_to_was
113
113
114 # Returns a SQL conditions string used to find all issues visible by the specified user
114 # Returns a SQL conditions string used to find all issues visible by the specified user
115 def self.visible_condition(user, options={})
115 def self.visible_condition(user, options={})
116 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
116 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
117 if user.id && user.logged?
117 if user.id && user.logged?
118 case role.issues_visibility
118 case role.issues_visibility
119 when 'all'
119 when 'all'
120 nil
120 nil
121 when 'default'
121 when 'default'
122 user_ids = [user.id] + user.groups.map(&:id).compact
122 user_ids = [user.id] + user.groups.map(&:id).compact
123 "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
123 "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
124 when 'own'
124 when 'own'
125 user_ids = [user.id] + user.groups.map(&:id).compact
125 user_ids = [user.id] + user.groups.map(&:id).compact
126 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
126 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
127 else
127 else
128 '1=0'
128 '1=0'
129 end
129 end
130 else
130 else
131 "(#{table_name}.is_private = #{connection.quoted_false})"
131 "(#{table_name}.is_private = #{connection.quoted_false})"
132 end
132 end
133 end
133 end
134 end
134 end
135
135
136 # Returns true if usr or current user is allowed to view the issue
136 # Returns true if usr or current user is allowed to view the issue
137 def visible?(usr=nil)
137 def visible?(usr=nil)
138 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
138 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
139 if user.logged?
139 if user.logged?
140 case role.issues_visibility
140 case role.issues_visibility
141 when 'all'
141 when 'all'
142 true
142 true
143 when 'default'
143 when 'default'
144 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
144 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
145 when 'own'
145 when 'own'
146 self.author == user || user.is_or_belongs_to?(assigned_to)
146 self.author == user || user.is_or_belongs_to?(assigned_to)
147 else
147 else
148 false
148 false
149 end
149 end
150 else
150 else
151 !self.is_private?
151 !self.is_private?
152 end
152 end
153 end
153 end
154 end
154 end
155
155
156 # Returns true if user or current user is allowed to edit or add a note to the issue
156 # Returns true if user or current user is allowed to edit or add a note to the issue
157 def editable?(user=User.current)
157 def editable?(user=User.current)
158 user.allowed_to?(:edit_issues, project) || user.allowed_to?(:add_issue_notes, project)
158 user.allowed_to?(:edit_issues, project) || user.allowed_to?(:add_issue_notes, project)
159 end
159 end
160
160
161 def initialize(attributes=nil, *args)
161 def initialize(attributes=nil, *args)
162 super
162 super
163 if new_record?
163 if new_record?
164 # set default values for new records only
164 # set default values for new records only
165 self.status ||= IssueStatus.default
166 self.priority ||= IssuePriority.default
165 self.priority ||= IssuePriority.default
167 self.watcher_user_ids = []
166 self.watcher_user_ids = []
168 end
167 end
169 end
168 end
170
169
171 def create_or_update
170 def create_or_update
172 super
171 super
173 ensure
172 ensure
174 @status_was = nil
173 @status_was = nil
175 end
174 end
176 private :create_or_update
175 private :create_or_update
177
176
178 # AR#Persistence#destroy would raise and RecordNotFound exception
177 # AR#Persistence#destroy would raise and RecordNotFound exception
179 # if the issue was already deleted or updated (non matching lock_version).
178 # if the issue was already deleted or updated (non matching lock_version).
180 # This is a problem when bulk deleting issues or deleting a project
179 # This is a problem when bulk deleting issues or deleting a project
181 # (because an issue may already be deleted if its parent was deleted
180 # (because an issue may already be deleted if its parent was deleted
182 # first).
181 # first).
183 # The issue is reloaded by the nested_set before being deleted so
182 # The issue is reloaded by the nested_set before being deleted so
184 # the lock_version condition should not be an issue but we handle it.
183 # the lock_version condition should not be an issue but we handle it.
185 def destroy
184 def destroy
186 super
185 super
187 rescue ActiveRecord::RecordNotFound
186 rescue ActiveRecord::RecordNotFound
188 # Stale or already deleted
187 # Stale or already deleted
189 begin
188 begin
190 reload
189 reload
191 rescue ActiveRecord::RecordNotFound
190 rescue ActiveRecord::RecordNotFound
192 # The issue was actually already deleted
191 # The issue was actually already deleted
193 @destroyed = true
192 @destroyed = true
194 return freeze
193 return freeze
195 end
194 end
196 # The issue was stale, retry to destroy
195 # The issue was stale, retry to destroy
197 super
196 super
198 end
197 end
199
198
200 alias :base_reload :reload
199 alias :base_reload :reload
201 def reload(*args)
200 def reload(*args)
202 @workflow_rule_by_attribute = nil
201 @workflow_rule_by_attribute = nil
203 @assignable_versions = nil
202 @assignable_versions = nil
204 @relations = nil
203 @relations = nil
205 base_reload(*args)
204 base_reload(*args)
206 end
205 end
207
206
208 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
207 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
209 def available_custom_fields
208 def available_custom_fields
210 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields) : []
209 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields) : []
211 end
210 end
212
211
213 def visible_custom_field_values(user=nil)
212 def visible_custom_field_values(user=nil)
214 user_real = user || User.current
213 user_real = user || User.current
215 custom_field_values.select do |value|
214 custom_field_values.select do |value|
216 value.custom_field.visible_by?(project, user_real)
215 value.custom_field.visible_by?(project, user_real)
217 end
216 end
218 end
217 end
219
218
220 # Copies attributes from another issue, arg can be an id or an Issue
219 # Copies attributes from another issue, arg can be an id or an Issue
221 def copy_from(arg, options={})
220 def copy_from(arg, options={})
222 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
221 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
223 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
222 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
224 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
223 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
225 self.status = issue.status
224 self.status = issue.status
226 self.author = User.current
225 self.author = User.current
227 unless options[:attachments] == false
226 unless options[:attachments] == false
228 self.attachments = issue.attachments.map do |attachement|
227 self.attachments = issue.attachments.map do |attachement|
229 attachement.copy(:container => self)
228 attachement.copy(:container => self)
230 end
229 end
231 end
230 end
232 @copied_from = issue
231 @copied_from = issue
233 @copy_options = options
232 @copy_options = options
234 self
233 self
235 end
234 end
236
235
237 # Returns an unsaved copy of the issue
236 # Returns an unsaved copy of the issue
238 def copy(attributes=nil, copy_options={})
237 def copy(attributes=nil, copy_options={})
239 copy = self.class.new.copy_from(self, copy_options)
238 copy = self.class.new.copy_from(self, copy_options)
240 copy.attributes = attributes if attributes
239 copy.attributes = attributes if attributes
241 copy
240 copy
242 end
241 end
243
242
244 # Returns true if the issue is a copy
243 # Returns true if the issue is a copy
245 def copy?
244 def copy?
246 @copied_from.present?
245 @copied_from.present?
247 end
246 end
248
247
249 # Moves/copies an issue to a new project and tracker
248 # Moves/copies an issue to a new project and tracker
250 # Returns the moved/copied issue on success, false on failure
249 # Returns the moved/copied issue on success, false on failure
251 def move_to_project(new_project, new_tracker=nil, options={})
250 def move_to_project(new_project, new_tracker=nil, options={})
252 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
251 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
253
252
254 if options[:copy]
253 if options[:copy]
255 issue = self.copy
254 issue = self.copy
256 else
255 else
257 issue = self
256 issue = self
258 end
257 end
259
258
260 issue.init_journal(User.current, options[:notes])
259 issue.init_journal(User.current, options[:notes])
261
260
262 # Preserve previous behaviour
261 # Preserve previous behaviour
263 # #move_to_project doesn't change tracker automatically
262 # #move_to_project doesn't change tracker automatically
264 issue.send :project=, new_project, true
263 issue.send :project=, new_project, true
265 if new_tracker
264 if new_tracker
266 issue.tracker = new_tracker
265 issue.tracker = new_tracker
267 end
266 end
268 # Allow bulk setting of attributes on the issue
267 # Allow bulk setting of attributes on the issue
269 if options[:attributes]
268 if options[:attributes]
270 issue.attributes = options[:attributes]
269 issue.attributes = options[:attributes]
271 end
270 end
272
271
273 issue.save ? issue : false
272 issue.save ? issue : false
274 end
273 end
275
274
276 def status_id=(sid)
275 def status_id=(status_id)
277 self.status = nil
276 if status_id.to_s != self.status_id.to_s
278 result = write_attribute(:status_id, sid)
277 self.status = (status_id.present? ? IssueStatus.find_by_id(status_id) : nil)
279 @workflow_rule_by_attribute = nil
278 end
280 result
279 self.status_id
280 end
281
282 # Sets the status.
283 def self.status=(status)
284 if status != self.status
285 @workflow_rule_by_attribute = nil
286 end
287 association(:status).writer(status)
281 end
288 end
282
289
283 def priority_id=(pid)
290 def priority_id=(pid)
284 self.priority = nil
291 self.priority = nil
285 write_attribute(:priority_id, pid)
292 write_attribute(:priority_id, pid)
286 end
293 end
287
294
288 def category_id=(cid)
295 def category_id=(cid)
289 self.category = nil
296 self.category = nil
290 write_attribute(:category_id, cid)
297 write_attribute(:category_id, cid)
291 end
298 end
292
299
293 def fixed_version_id=(vid)
300 def fixed_version_id=(vid)
294 self.fixed_version = nil
301 self.fixed_version = nil
295 write_attribute(:fixed_version_id, vid)
302 write_attribute(:fixed_version_id, vid)
296 end
303 end
297
304
298 def tracker_id=(tracker_id)
305 def tracker_id=(tracker_id)
299 if tracker_id.to_s != self.tracker_id.to_s
306 if tracker_id.to_s != self.tracker_id.to_s
300 self.tracker = (tracker_id.present? ? Tracker.find_by_id(tracker_id) : nil)
307 self.tracker = (tracker_id.present? ? Tracker.find_by_id(tracker_id) : nil)
301 end
308 end
302 self.tracker_id
309 self.tracker_id
303 end
310 end
304
311
312 # Sets the tracker.
313 # This will set the status to the default status of the new tracker if:
314 # * the status was the default for the previous tracker
315 # * or if the status was not part of the new tracker statuses
316 # * or the status was nil
305 def tracker=(tracker)
317 def tracker=(tracker)
306 if tracker != self.tracker
318 if tracker != self.tracker
319 if status == default_status
320 self.status = nil
321 elsif status && tracker && !tracker.issue_status_ids.include?(status.id)
322 self.status = nil
323 end
307 @custom_field_values = nil
324 @custom_field_values = nil
308 @workflow_rule_by_attribute = nil
325 @workflow_rule_by_attribute = nil
309 end
326 end
310 association(:tracker).writer(tracker)
327 association(:tracker).writer(tracker)
328 self.status ||= default_status
329 self.tracker
311 end
330 end
312
331
313 def project_id=(project_id)
332 def project_id=(project_id)
314 if project_id.to_s != self.project_id.to_s
333 if project_id.to_s != self.project_id.to_s
315 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
334 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
316 end
335 end
317 self.project_id
336 self.project_id
318 end
337 end
319
338
339 # Sets the project.
340 # Unless keep_tracker argument is set to true, this will change the tracker
341 # to the first tracker of the new project if the previous tracker is not part
342 # of the new project trackers.
343 # This will clear the fixed_version is it's no longer valid for the new project.
344 # This will clear the parent issue if it's no longer valid for the new project.
345 # This will set the category to the category with the same name in the new
346 # project if it exists, or clear it if it doesn't.
320 def project=(project, keep_tracker=false)
347 def project=(project, keep_tracker=false)
321 project_was = self.project
348 project_was = self.project
322 association(:project).writer(project)
349 association(:project).writer(project)
323 if project_was && project && project_was != project
350 if project_was && project && project_was != project
324 @assignable_versions = nil
351 @assignable_versions = nil
325
352
326 unless keep_tracker || project.trackers.include?(tracker)
353 unless keep_tracker || project.trackers.include?(tracker)
327 self.tracker = project.trackers.first
354 self.tracker = project.trackers.first
328 end
355 end
329 # Reassign to the category with same name if any
356 # Reassign to the category with same name if any
330 if category
357 if category
331 self.category = project.issue_categories.find_by_name(category.name)
358 self.category = project.issue_categories.find_by_name(category.name)
332 end
359 end
333 # Keep the fixed_version if it's still valid in the new_project
360 # Keep the fixed_version if it's still valid in the new_project
334 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
361 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
335 self.fixed_version = nil
362 self.fixed_version = nil
336 end
363 end
337 # Clear the parent task if it's no longer valid
364 # Clear the parent task if it's no longer valid
338 unless valid_parent_project?
365 unless valid_parent_project?
339 self.parent_issue_id = nil
366 self.parent_issue_id = nil
340 end
367 end
341 @custom_field_values = nil
368 @custom_field_values = nil
369 @workflow_rule_by_attribute = nil
342 end
370 end
371 self.project
343 end
372 end
344
373
345 def description=(arg)
374 def description=(arg)
346 if arg.is_a?(String)
375 if arg.is_a?(String)
347 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
376 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
348 end
377 end
349 write_attribute(:description, arg)
378 write_attribute(:description, arg)
350 end
379 end
351
380
352 # Overrides assign_attributes so that project and tracker get assigned first
381 # Overrides assign_attributes so that project and tracker get assigned first
353 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
382 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
354 return if new_attributes.nil?
383 return if new_attributes.nil?
355 attrs = new_attributes.dup
384 attrs = new_attributes.dup
356 attrs.stringify_keys!
385 attrs.stringify_keys!
357
386
358 %w(project project_id tracker tracker_id).each do |attr|
387 %w(project project_id tracker tracker_id).each do |attr|
359 if attrs.has_key?(attr)
388 if attrs.has_key?(attr)
360 send "#{attr}=", attrs.delete(attr)
389 send "#{attr}=", attrs.delete(attr)
361 end
390 end
362 end
391 end
363 send :assign_attributes_without_project_and_tracker_first, attrs, *args
392 send :assign_attributes_without_project_and_tracker_first, attrs, *args
364 end
393 end
365 # Do not redefine alias chain on reload (see #4838)
394 # Do not redefine alias chain on reload (see #4838)
366 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
395 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
367
396
368 def attributes=(new_attributes)
397 def attributes=(new_attributes)
369 assign_attributes new_attributes
398 assign_attributes new_attributes
370 end
399 end
371
400
372 def estimated_hours=(h)
401 def estimated_hours=(h)
373 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
402 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
374 end
403 end
375
404
376 safe_attributes 'project_id',
405 safe_attributes 'project_id',
377 :if => lambda {|issue, user|
406 :if => lambda {|issue, user|
378 if issue.new_record?
407 if issue.new_record?
379 issue.copy?
408 issue.copy?
380 elsif user.allowed_to?(:move_issues, issue.project)
409 elsif user.allowed_to?(:move_issues, issue.project)
381 Issue.allowed_target_projects_on_move.count > 1
410 Issue.allowed_target_projects_on_move.count > 1
382 end
411 end
383 }
412 }
384
413
385 safe_attributes 'tracker_id',
414 safe_attributes 'tracker_id',
386 'status_id',
415 'status_id',
387 'category_id',
416 'category_id',
388 'assigned_to_id',
417 'assigned_to_id',
389 'priority_id',
418 'priority_id',
390 'fixed_version_id',
419 'fixed_version_id',
391 'subject',
420 'subject',
392 'description',
421 'description',
393 'start_date',
422 'start_date',
394 'due_date',
423 'due_date',
395 'done_ratio',
424 'done_ratio',
396 'estimated_hours',
425 'estimated_hours',
397 'custom_field_values',
426 'custom_field_values',
398 'custom_fields',
427 'custom_fields',
399 'lock_version',
428 'lock_version',
400 'notes',
429 'notes',
401 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
430 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
402
431
403 safe_attributes 'status_id',
432 safe_attributes 'status_id',
404 'assigned_to_id',
433 'assigned_to_id',
405 'fixed_version_id',
434 'fixed_version_id',
406 'done_ratio',
435 'done_ratio',
407 'lock_version',
436 'lock_version',
408 'notes',
437 'notes',
409 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
438 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
410
439
411 safe_attributes 'notes',
440 safe_attributes 'notes',
412 :if => lambda {|issue, user| user.allowed_to?(:add_issue_notes, issue.project)}
441 :if => lambda {|issue, user| user.allowed_to?(:add_issue_notes, issue.project)}
413
442
414 safe_attributes 'private_notes',
443 safe_attributes 'private_notes',
415 :if => lambda {|issue, user| !issue.new_record? && user.allowed_to?(:set_notes_private, issue.project)}
444 :if => lambda {|issue, user| !issue.new_record? && user.allowed_to?(:set_notes_private, issue.project)}
416
445
417 safe_attributes 'watcher_user_ids',
446 safe_attributes 'watcher_user_ids',
418 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
447 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
419
448
420 safe_attributes 'is_private',
449 safe_attributes 'is_private',
421 :if => lambda {|issue, user|
450 :if => lambda {|issue, user|
422 user.allowed_to?(:set_issues_private, issue.project) ||
451 user.allowed_to?(:set_issues_private, issue.project) ||
423 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
452 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
424 }
453 }
425
454
426 safe_attributes 'parent_issue_id',
455 safe_attributes 'parent_issue_id',
427 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
456 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
428 user.allowed_to?(:manage_subtasks, issue.project)}
457 user.allowed_to?(:manage_subtasks, issue.project)}
429
458
430 def safe_attribute_names(user=nil)
459 def safe_attribute_names(user=nil)
431 names = super
460 names = super
432 names -= disabled_core_fields
461 names -= disabled_core_fields
433 names -= read_only_attribute_names(user)
462 names -= read_only_attribute_names(user)
434 names
463 names
435 end
464 end
436
465
437 # Safely sets attributes
466 # Safely sets attributes
438 # Should be called from controllers instead of #attributes=
467 # Should be called from controllers instead of #attributes=
439 # attr_accessible is too rough because we still want things like
468 # attr_accessible is too rough because we still want things like
440 # Issue.new(:project => foo) to work
469 # Issue.new(:project => foo) to work
441 def safe_attributes=(attrs, user=User.current)
470 def safe_attributes=(attrs, user=User.current)
442 return unless attrs.is_a?(Hash)
471 return unless attrs.is_a?(Hash)
443
472
444 attrs = attrs.deep_dup
473 attrs = attrs.deep_dup
445
474
446 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
475 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
447 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
476 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
448 if allowed_target_projects(user).where(:id => p.to_i).exists?
477 if allowed_target_projects(user).where(:id => p.to_i).exists?
449 self.project_id = p
478 self.project_id = p
450 end
479 end
451 end
480 end
452
481
453 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
482 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
454 self.tracker_id = t
483 self.tracker_id = t
455 end
484 end
456
485
457 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
486 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
458 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
487 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
459 self.status_id = s
488 self.status_id = s
460 end
489 end
461 end
490 end
462
491
463 attrs = delete_unsafe_attributes(attrs, user)
492 attrs = delete_unsafe_attributes(attrs, user)
464 return if attrs.empty?
493 return if attrs.empty?
465
494
466 unless leaf?
495 unless leaf?
467 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
496 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
468 end
497 end
469
498
470 if attrs['parent_issue_id'].present?
499 if attrs['parent_issue_id'].present?
471 s = attrs['parent_issue_id'].to_s
500 s = attrs['parent_issue_id'].to_s
472 unless (m = s.match(%r{\A#?(\d+)\z})) && (m[1] == parent_id.to_s || Issue.visible(user).exists?(m[1]))
501 unless (m = s.match(%r{\A#?(\d+)\z})) && (m[1] == parent_id.to_s || Issue.visible(user).exists?(m[1]))
473 @invalid_parent_issue_id = attrs.delete('parent_issue_id')
502 @invalid_parent_issue_id = attrs.delete('parent_issue_id')
474 end
503 end
475 end
504 end
476
505
477 if attrs['custom_field_values'].present?
506 if attrs['custom_field_values'].present?
478 editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}
507 editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}
479 attrs['custom_field_values'].select! {|k, v| editable_custom_field_ids.include?(k.to_s)}
508 attrs['custom_field_values'].select! {|k, v| editable_custom_field_ids.include?(k.to_s)}
480 end
509 end
481
510
482 if attrs['custom_fields'].present?
511 if attrs['custom_fields'].present?
483 editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}
512 editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}
484 attrs['custom_fields'].select! {|c| editable_custom_field_ids.include?(c['id'].to_s)}
513 attrs['custom_fields'].select! {|c| editable_custom_field_ids.include?(c['id'].to_s)}
485 end
514 end
486
515
487 # mass-assignment security bypass
516 # mass-assignment security bypass
488 assign_attributes attrs, :without_protection => true
517 assign_attributes attrs, :without_protection => true
489 end
518 end
490
519
491 def disabled_core_fields
520 def disabled_core_fields
492 tracker ? tracker.disabled_core_fields : []
521 tracker ? tracker.disabled_core_fields : []
493 end
522 end
494
523
495 # Returns the custom_field_values that can be edited by the given user
524 # Returns the custom_field_values that can be edited by the given user
496 def editable_custom_field_values(user=nil)
525 def editable_custom_field_values(user=nil)
497 visible_custom_field_values(user).reject do |value|
526 visible_custom_field_values(user).reject do |value|
498 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
527 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
499 end
528 end
500 end
529 end
501
530
502 # Returns the custom fields that can be edited by the given user
531 # Returns the custom fields that can be edited by the given user
503 def editable_custom_fields(user=nil)
532 def editable_custom_fields(user=nil)
504 editable_custom_field_values(user).map(&:custom_field).uniq
533 editable_custom_field_values(user).map(&:custom_field).uniq
505 end
534 end
506
535
507 # Returns the names of attributes that are read-only for user or the current user
536 # Returns the names of attributes that are read-only for user or the current user
508 # For users with multiple roles, the read-only fields are the intersection of
537 # For users with multiple roles, the read-only fields are the intersection of
509 # read-only fields of each role
538 # read-only fields of each role
510 # The result is an array of strings where sustom fields are represented with their ids
539 # The result is an array of strings where sustom fields are represented with their ids
511 #
540 #
512 # Examples:
541 # Examples:
513 # issue.read_only_attribute_names # => ['due_date', '2']
542 # issue.read_only_attribute_names # => ['due_date', '2']
514 # issue.read_only_attribute_names(user) # => []
543 # issue.read_only_attribute_names(user) # => []
515 def read_only_attribute_names(user=nil)
544 def read_only_attribute_names(user=nil)
516 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
545 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
517 end
546 end
518
547
519 # Returns the names of required attributes for user or the current user
548 # Returns the names of required attributes for user or the current user
520 # For users with multiple roles, the required fields are the intersection of
549 # For users with multiple roles, the required fields are the intersection of
521 # required fields of each role
550 # required fields of each role
522 # The result is an array of strings where sustom fields are represented with their ids
551 # The result is an array of strings where sustom fields are represented with their ids
523 #
552 #
524 # Examples:
553 # Examples:
525 # issue.required_attribute_names # => ['due_date', '2']
554 # issue.required_attribute_names # => ['due_date', '2']
526 # issue.required_attribute_names(user) # => []
555 # issue.required_attribute_names(user) # => []
527 def required_attribute_names(user=nil)
556 def required_attribute_names(user=nil)
528 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
557 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
529 end
558 end
530
559
531 # Returns true if the attribute is required for user
560 # Returns true if the attribute is required for user
532 def required_attribute?(name, user=nil)
561 def required_attribute?(name, user=nil)
533 required_attribute_names(user).include?(name.to_s)
562 required_attribute_names(user).include?(name.to_s)
534 end
563 end
535
564
536 # Returns a hash of the workflow rule by attribute for the given user
565 # Returns a hash of the workflow rule by attribute for the given user
537 #
566 #
538 # Examples:
567 # Examples:
539 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
568 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
540 def workflow_rule_by_attribute(user=nil)
569 def workflow_rule_by_attribute(user=nil)
541 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
570 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
542
571
543 user_real = user || User.current
572 user_real = user || User.current
544 roles = user_real.admin ? Role.all.to_a : user_real.roles_for_project(project)
573 roles = user_real.admin ? Role.all.to_a : user_real.roles_for_project(project)
545 return {} if roles.empty?
574 return {} if roles.empty?
546
575
547 result = {}
576 result = {}
548 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).to_a
577 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).to_a
549 if workflow_permissions.any?
578 if workflow_permissions.any?
550 workflow_rules = workflow_permissions.inject({}) do |h, wp|
579 workflow_rules = workflow_permissions.inject({}) do |h, wp|
551 h[wp.field_name] ||= []
580 h[wp.field_name] ||= []
552 h[wp.field_name] << wp.rule
581 h[wp.field_name] << wp.rule
553 h
582 h
554 end
583 end
555 workflow_rules.each do |attr, rules|
584 workflow_rules.each do |attr, rules|
556 next if rules.size < roles.size
585 next if rules.size < roles.size
557 uniq_rules = rules.uniq
586 uniq_rules = rules.uniq
558 if uniq_rules.size == 1
587 if uniq_rules.size == 1
559 result[attr] = uniq_rules.first
588 result[attr] = uniq_rules.first
560 else
589 else
561 result[attr] = 'required'
590 result[attr] = 'required'
562 end
591 end
563 end
592 end
564 end
593 end
565 @workflow_rule_by_attribute = result if user.nil?
594 @workflow_rule_by_attribute = result if user.nil?
566 result
595 result
567 end
596 end
568 private :workflow_rule_by_attribute
597 private :workflow_rule_by_attribute
569
598
570 def done_ratio
599 def done_ratio
571 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
600 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
572 status.default_done_ratio
601 status.default_done_ratio
573 else
602 else
574 read_attribute(:done_ratio)
603 read_attribute(:done_ratio)
575 end
604 end
576 end
605 end
577
606
578 def self.use_status_for_done_ratio?
607 def self.use_status_for_done_ratio?
579 Setting.issue_done_ratio == 'issue_status'
608 Setting.issue_done_ratio == 'issue_status'
580 end
609 end
581
610
582 def self.use_field_for_done_ratio?
611 def self.use_field_for_done_ratio?
583 Setting.issue_done_ratio == 'issue_field'
612 Setting.issue_done_ratio == 'issue_field'
584 end
613 end
585
614
586 def validate_issue
615 def validate_issue
587 if due_date && start_date && (start_date_changed? || due_date_changed?) && due_date < start_date
616 if due_date && start_date && (start_date_changed? || due_date_changed?) && due_date < start_date
588 errors.add :due_date, :greater_than_start_date
617 errors.add :due_date, :greater_than_start_date
589 end
618 end
590
619
591 if start_date && start_date_changed? && soonest_start && start_date < soonest_start
620 if start_date && start_date_changed? && soonest_start && start_date < soonest_start
592 errors.add :start_date, :earlier_than_minimum_start_date, :date => format_date(soonest_start)
621 errors.add :start_date, :earlier_than_minimum_start_date, :date => format_date(soonest_start)
593 end
622 end
594
623
595 if fixed_version
624 if fixed_version
596 if !assignable_versions.include?(fixed_version)
625 if !assignable_versions.include?(fixed_version)
597 errors.add :fixed_version_id, :inclusion
626 errors.add :fixed_version_id, :inclusion
598 elsif reopening? && fixed_version.closed?
627 elsif reopening? && fixed_version.closed?
599 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
628 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
600 end
629 end
601 end
630 end
602
631
603 # Checks that the issue can not be added/moved to a disabled tracker
632 # Checks that the issue can not be added/moved to a disabled tracker
604 if project && (tracker_id_changed? || project_id_changed?)
633 if project && (tracker_id_changed? || project_id_changed?)
605 unless project.trackers.include?(tracker)
634 unless project.trackers.include?(tracker)
606 errors.add :tracker_id, :inclusion
635 errors.add :tracker_id, :inclusion
607 end
636 end
608 end
637 end
609
638
610 # Checks parent issue assignment
639 # Checks parent issue assignment
611 if @invalid_parent_issue_id.present?
640 if @invalid_parent_issue_id.present?
612 errors.add :parent_issue_id, :invalid
641 errors.add :parent_issue_id, :invalid
613 elsif @parent_issue
642 elsif @parent_issue
614 if !valid_parent_project?(@parent_issue)
643 if !valid_parent_project?(@parent_issue)
615 errors.add :parent_issue_id, :invalid
644 errors.add :parent_issue_id, :invalid
616 elsif (@parent_issue != parent) && (all_dependent_issues.include?(@parent_issue) || @parent_issue.all_dependent_issues.include?(self))
645 elsif (@parent_issue != parent) && (all_dependent_issues.include?(@parent_issue) || @parent_issue.all_dependent_issues.include?(self))
617 errors.add :parent_issue_id, :invalid
646 errors.add :parent_issue_id, :invalid
618 elsif !new_record?
647 elsif !new_record?
619 # moving an existing issue
648 # moving an existing issue
620 if @parent_issue.root_id != root_id
649 if @parent_issue.root_id != root_id
621 # we can always move to another tree
650 # we can always move to another tree
622 elsif move_possible?(@parent_issue)
651 elsif move_possible?(@parent_issue)
623 # move accepted inside tree
652 # move accepted inside tree
624 else
653 else
625 errors.add :parent_issue_id, :invalid
654 errors.add :parent_issue_id, :invalid
626 end
655 end
627 end
656 end
628 end
657 end
629 end
658 end
630
659
631 # Validates the issue against additional workflow requirements
660 # Validates the issue against additional workflow requirements
632 def validate_required_fields
661 def validate_required_fields
633 user = new_record? ? author : current_journal.try(:user)
662 user = new_record? ? author : current_journal.try(:user)
634
663
635 required_attribute_names(user).each do |attribute|
664 required_attribute_names(user).each do |attribute|
636 if attribute =~ /^\d+$/
665 if attribute =~ /^\d+$/
637 attribute = attribute.to_i
666 attribute = attribute.to_i
638 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
667 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
639 if v && v.value.blank?
668 if v && v.value.blank?
640 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
669 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
641 end
670 end
642 else
671 else
643 if respond_to?(attribute) && send(attribute).blank?
672 if respond_to?(attribute) && send(attribute).blank?
644 errors.add attribute, :blank
673 errors.add attribute, :blank
645 end
674 end
646 end
675 end
647 end
676 end
648 end
677 end
649
678
650 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
679 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
651 # even if the user turns off the setting later
680 # even if the user turns off the setting later
652 def update_done_ratio_from_issue_status
681 def update_done_ratio_from_issue_status
653 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
682 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
654 self.done_ratio = status.default_done_ratio
683 self.done_ratio = status.default_done_ratio
655 end
684 end
656 end
685 end
657
686
658 def init_journal(user, notes = "")
687 def init_journal(user, notes = "")
659 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
688 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
660 if new_record?
689 if new_record?
661 @current_journal.notify = false
690 @current_journal.notify = false
662 else
691 else
663 @attributes_before_change = attributes.dup
692 @attributes_before_change = attributes.dup
664 @custom_values_before_change = {}
693 @custom_values_before_change = {}
665 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
694 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
666 end
695 end
667 @current_journal
696 @current_journal
668 end
697 end
669
698
670 # Returns the current journal or nil if it's not initialized
699 # Returns the current journal or nil if it's not initialized
671 def current_journal
700 def current_journal
672 @current_journal
701 @current_journal
673 end
702 end
674
703
675 # Returns the id of the last journal or nil
704 # Returns the id of the last journal or nil
676 def last_journal_id
705 def last_journal_id
677 if new_record?
706 if new_record?
678 nil
707 nil
679 else
708 else
680 journals.maximum(:id)
709 journals.maximum(:id)
681 end
710 end
682 end
711 end
683
712
684 # Returns a scope for journals that have an id greater than journal_id
713 # Returns a scope for journals that have an id greater than journal_id
685 def journals_after(journal_id)
714 def journals_after(journal_id)
686 scope = journals.reorder("#{Journal.table_name}.id ASC")
715 scope = journals.reorder("#{Journal.table_name}.id ASC")
687 if journal_id.present?
716 if journal_id.present?
688 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
717 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
689 end
718 end
690 scope
719 scope
691 end
720 end
692
721
693 # Returns the initial status of the issue
722 # Returns the initial status of the issue
694 # Returns nil for a new issue
723 # Returns nil for a new issue
695 def status_was
724 def status_was
696 if status_id_was && status_id_was.to_i > 0
725 if status_id_was && status_id_was.to_i > 0
697 @status_was ||= IssueStatus.find_by_id(status_id_was)
726 @status_was ||= IssueStatus.find_by_id(status_id_was)
698 end
727 end
699 end
728 end
700
729
701 # Return true if the issue is closed, otherwise false
730 # Return true if the issue is closed, otherwise false
702 def closed?
731 def closed?
703 status.present? && status.is_closed?
732 status.present? && status.is_closed?
704 end
733 end
705
734
706 # Returns true if the issue was closed when loaded
735 # Returns true if the issue was closed when loaded
707 def was_closed?
736 def was_closed?
708 status_was.present? && status_was.is_closed?
737 status_was.present? && status_was.is_closed?
709 end
738 end
710
739
711 # Return true if the issue is being reopened
740 # Return true if the issue is being reopened
712 def reopening?
741 def reopening?
713 if new_record?
742 if new_record?
714 false
743 false
715 else
744 else
716 status_id_changed? && !closed? && was_closed?
745 status_id_changed? && !closed? && was_closed?
717 end
746 end
718 end
747 end
719 alias :reopened? :reopening?
748 alias :reopened? :reopening?
720
749
721 # Return true if the issue is being closed
750 # Return true if the issue is being closed
722 def closing?
751 def closing?
723 if new_record?
752 if new_record?
724 closed?
753 closed?
725 else
754 else
726 status_id_changed? && closed? && !was_closed?
755 status_id_changed? && closed? && !was_closed?
727 end
756 end
728 end
757 end
729
758
730 # Returns true if the issue is overdue
759 # Returns true if the issue is overdue
731 def overdue?
760 def overdue?
732 due_date.present? && (due_date < Date.today) && !closed?
761 due_date.present? && (due_date < Date.today) && !closed?
733 end
762 end
734
763
735 # Is the amount of work done less than it should for the due date
764 # Is the amount of work done less than it should for the due date
736 def behind_schedule?
765 def behind_schedule?
737 return false if start_date.nil? || due_date.nil?
766 return false if start_date.nil? || due_date.nil?
738 done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor
767 done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor
739 return done_date <= Date.today
768 return done_date <= Date.today
740 end
769 end
741
770
742 # Does this issue have children?
771 # Does this issue have children?
743 def children?
772 def children?
744 !leaf?
773 !leaf?
745 end
774 end
746
775
747 # Users the issue can be assigned to
776 # Users the issue can be assigned to
748 def assignable_users
777 def assignable_users
749 users = project.assignable_users.to_a
778 users = project.assignable_users.to_a
750 users << author if author
779 users << author if author
751 users << assigned_to if assigned_to
780 users << assigned_to if assigned_to
752 users.uniq.sort
781 users.uniq.sort
753 end
782 end
754
783
755 # Versions that the issue can be assigned to
784 # Versions that the issue can be assigned to
756 def assignable_versions
785 def assignable_versions
757 return @assignable_versions if @assignable_versions
786 return @assignable_versions if @assignable_versions
758
787
759 versions = project.shared_versions.open.to_a
788 versions = project.shared_versions.open.to_a
760 if fixed_version
789 if fixed_version
761 if fixed_version_id_changed?
790 if fixed_version_id_changed?
762 # nothing to do
791 # nothing to do
763 elsif project_id_changed?
792 elsif project_id_changed?
764 if project.shared_versions.include?(fixed_version)
793 if project.shared_versions.include?(fixed_version)
765 versions << fixed_version
794 versions << fixed_version
766 end
795 end
767 else
796 else
768 versions << fixed_version
797 versions << fixed_version
769 end
798 end
770 end
799 end
771 @assignable_versions = versions.uniq.sort
800 @assignable_versions = versions.uniq.sort
772 end
801 end
773
802
774 # Returns true if this issue is blocked by another issue that is still open
803 # Returns true if this issue is blocked by another issue that is still open
775 def blocked?
804 def blocked?
776 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
805 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
777 end
806 end
778
807
808 # Returns the default status of the issue based on its tracker
809 # Returns nil if tracker is nil
810 def default_status
811 tracker.try(:default_status)
812 end
813
779 # Returns an array of statuses that user is able to apply
814 # Returns an array of statuses that user is able to apply
780 def new_statuses_allowed_to(user=User.current, include_default=false)
815 def new_statuses_allowed_to(user=User.current, include_default=false)
781 if new_record? && @copied_from
816 if new_record? && @copied_from
782 [IssueStatus.default, @copied_from.status].compact.uniq.sort
817 [default_status, @copied_from.status].compact.uniq.sort
783 else
818 else
784 initial_status = nil
819 initial_status = nil
785 if new_record?
820 if new_record?
786 initial_status = IssueStatus.default
821 initial_status = default_status
822 elsif tracker_id_changed?
823 if Tracker.where(:id => tracker_id_was, :default_status_id => status_id_was).any?
824 initial_status = default_status
825 elsif tracker.issue_status_ids.include?(status_id_was)
826 initial_status = IssueStatus.find_by_id(status_id_was)
827 else
828 initial_status = default_status
829 end
787 else
830 else
788 initial_status = status_was
831 initial_status = status_was
789 end
832 end
790
833
791 initial_assigned_to_id = assigned_to_id_changed? ? assigned_to_id_was : assigned_to_id
834 initial_assigned_to_id = assigned_to_id_changed? ? assigned_to_id_was : assigned_to_id
792 assignee_transitions_allowed = initial_assigned_to_id.present? &&
835 assignee_transitions_allowed = initial_assigned_to_id.present? &&
793 (user.id == initial_assigned_to_id || user.group_ids.include?(initial_assigned_to_id))
836 (user.id == initial_assigned_to_id || user.group_ids.include?(initial_assigned_to_id))
794
837
795 statuses = []
838 statuses = []
796 if initial_status
839 if initial_status
797 statuses += initial_status.find_new_statuses_allowed_to(
840 statuses += initial_status.find_new_statuses_allowed_to(
798 user.admin ? Role.all.to_a : user.roles_for_project(project),
841 user.admin ? Role.all.to_a : user.roles_for_project(project),
799 tracker,
842 tracker,
800 author == user,
843 author == user,
801 assignee_transitions_allowed
844 assignee_transitions_allowed
802 )
845 )
803 end
846 end
804 statuses << initial_status unless statuses.empty?
847 statuses << initial_status unless statuses.empty?
805 statuses << IssueStatus.default if include_default
848 statuses << default_status if include_default
806 statuses = statuses.compact.uniq.sort
849 statuses = statuses.compact.uniq.sort
807 if blocked?
850 if blocked?
808 statuses.reject!(&:is_closed?)
851 statuses.reject!(&:is_closed?)
809 end
852 end
810 statuses
853 statuses
811 end
854 end
812 end
855 end
813
856
814 # Returns the previous assignee if changed
857 # Returns the previous assignee if changed
815 def assigned_to_was
858 def assigned_to_was
816 # assigned_to_id_was is reset before after_save callbacks
859 # assigned_to_id_was is reset before after_save callbacks
817 user_id = @previous_assigned_to_id || assigned_to_id_was
860 user_id = @previous_assigned_to_id || assigned_to_id_was
818 if user_id && user_id != assigned_to_id
861 if user_id && user_id != assigned_to_id
819 @assigned_to_was ||= User.find_by_id(user_id)
862 @assigned_to_was ||= User.find_by_id(user_id)
820 end
863 end
821 end
864 end
822
865
823 # Returns the users that should be notified
866 # Returns the users that should be notified
824 def notified_users
867 def notified_users
825 notified = []
868 notified = []
826 # Author and assignee are always notified unless they have been
869 # Author and assignee are always notified unless they have been
827 # locked or don't want to be notified
870 # locked or don't want to be notified
828 notified << author if author
871 notified << author if author
829 if assigned_to
872 if assigned_to
830 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
873 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
831 end
874 end
832 if assigned_to_was
875 if assigned_to_was
833 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
876 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
834 end
877 end
835 notified = notified.select {|u| u.active? && u.notify_about?(self)}
878 notified = notified.select {|u| u.active? && u.notify_about?(self)}
836
879
837 notified += project.notified_users
880 notified += project.notified_users
838 notified.uniq!
881 notified.uniq!
839 # Remove users that can not view the issue
882 # Remove users that can not view the issue
840 notified.reject! {|user| !visible?(user)}
883 notified.reject! {|user| !visible?(user)}
841 notified
884 notified
842 end
885 end
843
886
844 # Returns the email addresses that should be notified
887 # Returns the email addresses that should be notified
845 def recipients
888 def recipients
846 notified_users.collect(&:mail)
889 notified_users.collect(&:mail)
847 end
890 end
848
891
849 def each_notification(users, &block)
892 def each_notification(users, &block)
850 if users.any?
893 if users.any?
851 if custom_field_values.detect {|value| !value.custom_field.visible?}
894 if custom_field_values.detect {|value| !value.custom_field.visible?}
852 users_by_custom_field_visibility = users.group_by do |user|
895 users_by_custom_field_visibility = users.group_by do |user|
853 visible_custom_field_values(user).map(&:custom_field_id).sort
896 visible_custom_field_values(user).map(&:custom_field_id).sort
854 end
897 end
855 users_by_custom_field_visibility.values.each do |users|
898 users_by_custom_field_visibility.values.each do |users|
856 yield(users)
899 yield(users)
857 end
900 end
858 else
901 else
859 yield(users)
902 yield(users)
860 end
903 end
861 end
904 end
862 end
905 end
863
906
864 # Returns the number of hours spent on this issue
907 # Returns the number of hours spent on this issue
865 def spent_hours
908 def spent_hours
866 @spent_hours ||= time_entries.sum(:hours) || 0
909 @spent_hours ||= time_entries.sum(:hours) || 0
867 end
910 end
868
911
869 # Returns the total number of hours spent on this issue and its descendants
912 # Returns the total number of hours spent on this issue and its descendants
870 #
913 #
871 # Example:
914 # Example:
872 # spent_hours => 0.0
915 # spent_hours => 0.0
873 # spent_hours => 50.2
916 # spent_hours => 50.2
874 def total_spent_hours
917 def total_spent_hours
875 @total_spent_hours ||=
918 @total_spent_hours ||=
876 self_and_descendants.
919 self_and_descendants.
877 joins("LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").
920 joins("LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").
878 sum("#{TimeEntry.table_name}.hours").to_f || 0.0
921 sum("#{TimeEntry.table_name}.hours").to_f || 0.0
879 end
922 end
880
923
881 def relations
924 def relations
882 @relations ||= IssueRelation::Relations.new(self, (relations_from + relations_to).sort)
925 @relations ||= IssueRelation::Relations.new(self, (relations_from + relations_to).sort)
883 end
926 end
884
927
885 # Preloads relations for a collection of issues
928 # Preloads relations for a collection of issues
886 def self.load_relations(issues)
929 def self.load_relations(issues)
887 if issues.any?
930 if issues.any?
888 relations = IssueRelation.where("issue_from_id IN (:ids) OR issue_to_id IN (:ids)", :ids => issues.map(&:id)).all
931 relations = IssueRelation.where("issue_from_id IN (:ids) OR issue_to_id IN (:ids)", :ids => issues.map(&:id)).all
889 issues.each do |issue|
932 issues.each do |issue|
890 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
933 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
891 end
934 end
892 end
935 end
893 end
936 end
894
937
895 # Preloads visible spent time for a collection of issues
938 # Preloads visible spent time for a collection of issues
896 def self.load_visible_spent_hours(issues, user=User.current)
939 def self.load_visible_spent_hours(issues, user=User.current)
897 if issues.any?
940 if issues.any?
898 hours_by_issue_id = TimeEntry.visible(user).group(:issue_id).sum(:hours)
941 hours_by_issue_id = TimeEntry.visible(user).group(:issue_id).sum(:hours)
899 issues.each do |issue|
942 issues.each do |issue|
900 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
943 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
901 end
944 end
902 end
945 end
903 end
946 end
904
947
905 # Preloads visible relations for a collection of issues
948 # Preloads visible relations for a collection of issues
906 def self.load_visible_relations(issues, user=User.current)
949 def self.load_visible_relations(issues, user=User.current)
907 if issues.any?
950 if issues.any?
908 issue_ids = issues.map(&:id)
951 issue_ids = issues.map(&:id)
909 # Relations with issue_from in given issues and visible issue_to
952 # Relations with issue_from in given issues and visible issue_to
910 relations_from = IssueRelation.joins(:issue_to => :project).
953 relations_from = IssueRelation.joins(:issue_to => :project).
911 where(visible_condition(user)).where(:issue_from_id => issue_ids).to_a
954 where(visible_condition(user)).where(:issue_from_id => issue_ids).to_a
912 # Relations with issue_to in given issues and visible issue_from
955 # Relations with issue_to in given issues and visible issue_from
913 relations_to = IssueRelation.joins(:issue_from => :project).
956 relations_to = IssueRelation.joins(:issue_from => :project).
914 where(visible_condition(user)).
957 where(visible_condition(user)).
915 where(:issue_to_id => issue_ids).to_a
958 where(:issue_to_id => issue_ids).to_a
916 issues.each do |issue|
959 issues.each do |issue|
917 relations =
960 relations =
918 relations_from.select {|relation| relation.issue_from_id == issue.id} +
961 relations_from.select {|relation| relation.issue_from_id == issue.id} +
919 relations_to.select {|relation| relation.issue_to_id == issue.id}
962 relations_to.select {|relation| relation.issue_to_id == issue.id}
920
963
921 issue.instance_variable_set "@relations", IssueRelation::Relations.new(issue, relations.sort)
964 issue.instance_variable_set "@relations", IssueRelation::Relations.new(issue, relations.sort)
922 end
965 end
923 end
966 end
924 end
967 end
925
968
926 # Finds an issue relation given its id.
969 # Finds an issue relation given its id.
927 def find_relation(relation_id)
970 def find_relation(relation_id)
928 IssueRelation.where("issue_to_id = ? OR issue_from_id = ?", id, id).find(relation_id)
971 IssueRelation.where("issue_to_id = ? OR issue_from_id = ?", id, id).find(relation_id)
929 end
972 end
930
973
931 # Returns all the other issues that depend on the issue
974 # Returns all the other issues that depend on the issue
932 # The algorithm is a modified breadth first search (bfs)
975 # The algorithm is a modified breadth first search (bfs)
933 def all_dependent_issues(except=[])
976 def all_dependent_issues(except=[])
934 # The found dependencies
977 # The found dependencies
935 dependencies = []
978 dependencies = []
936
979
937 # The visited flag for every node (issue) used by the breadth first search
980 # The visited flag for every node (issue) used by the breadth first search
938 eNOT_DISCOVERED = 0 # The issue is "new" to the algorithm, it has not seen it before.
981 eNOT_DISCOVERED = 0 # The issue is "new" to the algorithm, it has not seen it before.
939
982
940 ePROCESS_ALL = 1 # The issue is added to the queue. Process both children and relations of
983 ePROCESS_ALL = 1 # The issue is added to the queue. Process both children and relations of
941 # the issue when it is processed.
984 # the issue when it is processed.
942
985
943 ePROCESS_RELATIONS_ONLY = 2 # The issue was added to the queue and will be output as dependent issue,
986 ePROCESS_RELATIONS_ONLY = 2 # The issue was added to the queue and will be output as dependent issue,
944 # but its children will not be added to the queue when it is processed.
987 # but its children will not be added to the queue when it is processed.
945
988
946 eRELATIONS_PROCESSED = 3 # The related issues, the parent issue and the issue itself have been added to
989 eRELATIONS_PROCESSED = 3 # The related issues, the parent issue and the issue itself have been added to
947 # the queue, but its children have not been added.
990 # the queue, but its children have not been added.
948
991
949 ePROCESS_CHILDREN_ONLY = 4 # The relations and the parent of the issue have been added to the queue, but
992 ePROCESS_CHILDREN_ONLY = 4 # The relations and the parent of the issue have been added to the queue, but
950 # the children still need to be processed.
993 # the children still need to be processed.
951
994
952 eALL_PROCESSED = 5 # The issue and all its children, its parent and its related issues have been
995 eALL_PROCESSED = 5 # The issue and all its children, its parent and its related issues have been
953 # added as dependent issues. It needs no further processing.
996 # added as dependent issues. It needs no further processing.
954
997
955 issue_status = Hash.new(eNOT_DISCOVERED)
998 issue_status = Hash.new(eNOT_DISCOVERED)
956
999
957 # The queue
1000 # The queue
958 queue = []
1001 queue = []
959
1002
960 # Initialize the bfs, add start node (self) to the queue
1003 # Initialize the bfs, add start node (self) to the queue
961 queue << self
1004 queue << self
962 issue_status[self] = ePROCESS_ALL
1005 issue_status[self] = ePROCESS_ALL
963
1006
964 while (!queue.empty?) do
1007 while (!queue.empty?) do
965 current_issue = queue.shift
1008 current_issue = queue.shift
966 current_issue_status = issue_status[current_issue]
1009 current_issue_status = issue_status[current_issue]
967 dependencies << current_issue
1010 dependencies << current_issue
968
1011
969 # Add parent to queue, if not already in it.
1012 # Add parent to queue, if not already in it.
970 parent = current_issue.parent
1013 parent = current_issue.parent
971 parent_status = issue_status[parent]
1014 parent_status = issue_status[parent]
972
1015
973 if parent && (parent_status == eNOT_DISCOVERED) && !except.include?(parent)
1016 if parent && (parent_status == eNOT_DISCOVERED) && !except.include?(parent)
974 queue << parent
1017 queue << parent
975 issue_status[parent] = ePROCESS_RELATIONS_ONLY
1018 issue_status[parent] = ePROCESS_RELATIONS_ONLY
976 end
1019 end
977
1020
978 # Add children to queue, but only if they are not already in it and
1021 # Add children to queue, but only if they are not already in it and
979 # the children of the current node need to be processed.
1022 # the children of the current node need to be processed.
980 if (current_issue_status == ePROCESS_CHILDREN_ONLY || current_issue_status == ePROCESS_ALL)
1023 if (current_issue_status == ePROCESS_CHILDREN_ONLY || current_issue_status == ePROCESS_ALL)
981 current_issue.children.each do |child|
1024 current_issue.children.each do |child|
982 next if except.include?(child)
1025 next if except.include?(child)
983
1026
984 if (issue_status[child] == eNOT_DISCOVERED)
1027 if (issue_status[child] == eNOT_DISCOVERED)
985 queue << child
1028 queue << child
986 issue_status[child] = ePROCESS_ALL
1029 issue_status[child] = ePROCESS_ALL
987 elsif (issue_status[child] == eRELATIONS_PROCESSED)
1030 elsif (issue_status[child] == eRELATIONS_PROCESSED)
988 queue << child
1031 queue << child
989 issue_status[child] = ePROCESS_CHILDREN_ONLY
1032 issue_status[child] = ePROCESS_CHILDREN_ONLY
990 elsif (issue_status[child] == ePROCESS_RELATIONS_ONLY)
1033 elsif (issue_status[child] == ePROCESS_RELATIONS_ONLY)
991 queue << child
1034 queue << child
992 issue_status[child] = ePROCESS_ALL
1035 issue_status[child] = ePROCESS_ALL
993 end
1036 end
994 end
1037 end
995 end
1038 end
996
1039
997 # Add related issues to the queue, if they are not already in it.
1040 # Add related issues to the queue, if they are not already in it.
998 current_issue.relations_from.map(&:issue_to).each do |related_issue|
1041 current_issue.relations_from.map(&:issue_to).each do |related_issue|
999 next if except.include?(related_issue)
1042 next if except.include?(related_issue)
1000
1043
1001 if (issue_status[related_issue] == eNOT_DISCOVERED)
1044 if (issue_status[related_issue] == eNOT_DISCOVERED)
1002 queue << related_issue
1045 queue << related_issue
1003 issue_status[related_issue] = ePROCESS_ALL
1046 issue_status[related_issue] = ePROCESS_ALL
1004 elsif (issue_status[related_issue] == eRELATIONS_PROCESSED)
1047 elsif (issue_status[related_issue] == eRELATIONS_PROCESSED)
1005 queue << related_issue
1048 queue << related_issue
1006 issue_status[related_issue] = ePROCESS_CHILDREN_ONLY
1049 issue_status[related_issue] = ePROCESS_CHILDREN_ONLY
1007 elsif (issue_status[related_issue] == ePROCESS_RELATIONS_ONLY)
1050 elsif (issue_status[related_issue] == ePROCESS_RELATIONS_ONLY)
1008 queue << related_issue
1051 queue << related_issue
1009 issue_status[related_issue] = ePROCESS_ALL
1052 issue_status[related_issue] = ePROCESS_ALL
1010 end
1053 end
1011 end
1054 end
1012
1055
1013 # Set new status for current issue
1056 # Set new status for current issue
1014 if (current_issue_status == ePROCESS_ALL) || (current_issue_status == ePROCESS_CHILDREN_ONLY)
1057 if (current_issue_status == ePROCESS_ALL) || (current_issue_status == ePROCESS_CHILDREN_ONLY)
1015 issue_status[current_issue] = eALL_PROCESSED
1058 issue_status[current_issue] = eALL_PROCESSED
1016 elsif (current_issue_status == ePROCESS_RELATIONS_ONLY)
1059 elsif (current_issue_status == ePROCESS_RELATIONS_ONLY)
1017 issue_status[current_issue] = eRELATIONS_PROCESSED
1060 issue_status[current_issue] = eRELATIONS_PROCESSED
1018 end
1061 end
1019 end # while
1062 end # while
1020
1063
1021 # Remove the issues from the "except" parameter from the result array
1064 # Remove the issues from the "except" parameter from the result array
1022 dependencies -= except
1065 dependencies -= except
1023 dependencies.delete(self)
1066 dependencies.delete(self)
1024
1067
1025 dependencies
1068 dependencies
1026 end
1069 end
1027
1070
1028 # Returns an array of issues that duplicate this one
1071 # Returns an array of issues that duplicate this one
1029 def duplicates
1072 def duplicates
1030 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
1073 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
1031 end
1074 end
1032
1075
1033 # Returns the due date or the target due date if any
1076 # Returns the due date or the target due date if any
1034 # Used on gantt chart
1077 # Used on gantt chart
1035 def due_before
1078 def due_before
1036 due_date || (fixed_version ? fixed_version.effective_date : nil)
1079 due_date || (fixed_version ? fixed_version.effective_date : nil)
1037 end
1080 end
1038
1081
1039 # Returns the time scheduled for this issue.
1082 # Returns the time scheduled for this issue.
1040 #
1083 #
1041 # Example:
1084 # Example:
1042 # Start Date: 2/26/09, End Date: 3/04/09
1085 # Start Date: 2/26/09, End Date: 3/04/09
1043 # duration => 6
1086 # duration => 6
1044 def duration
1087 def duration
1045 (start_date && due_date) ? due_date - start_date : 0
1088 (start_date && due_date) ? due_date - start_date : 0
1046 end
1089 end
1047
1090
1048 # Returns the duration in working days
1091 # Returns the duration in working days
1049 def working_duration
1092 def working_duration
1050 (start_date && due_date) ? working_days(start_date, due_date) : 0
1093 (start_date && due_date) ? working_days(start_date, due_date) : 0
1051 end
1094 end
1052
1095
1053 def soonest_start(reload=false)
1096 def soonest_start(reload=false)
1054 @soonest_start = nil if reload
1097 @soonest_start = nil if reload
1055 @soonest_start ||= (
1098 @soonest_start ||= (
1056 relations_to(reload).collect{|relation| relation.successor_soonest_start} +
1099 relations_to(reload).collect{|relation| relation.successor_soonest_start} +
1057 [(@parent_issue || parent).try(:soonest_start)]
1100 [(@parent_issue || parent).try(:soonest_start)]
1058 ).compact.max
1101 ).compact.max
1059 end
1102 end
1060
1103
1061 # Sets start_date on the given date or the next working day
1104 # Sets start_date on the given date or the next working day
1062 # and changes due_date to keep the same working duration.
1105 # and changes due_date to keep the same working duration.
1063 def reschedule_on(date)
1106 def reschedule_on(date)
1064 wd = working_duration
1107 wd = working_duration
1065 date = next_working_date(date)
1108 date = next_working_date(date)
1066 self.start_date = date
1109 self.start_date = date
1067 self.due_date = add_working_days(date, wd)
1110 self.due_date = add_working_days(date, wd)
1068 end
1111 end
1069
1112
1070 # Reschedules the issue on the given date or the next working day and saves the record.
1113 # Reschedules the issue on the given date or the next working day and saves the record.
1071 # If the issue is a parent task, this is done by rescheduling its subtasks.
1114 # If the issue is a parent task, this is done by rescheduling its subtasks.
1072 def reschedule_on!(date)
1115 def reschedule_on!(date)
1073 return if date.nil?
1116 return if date.nil?
1074 if leaf?
1117 if leaf?
1075 if start_date.nil? || start_date != date
1118 if start_date.nil? || start_date != date
1076 if start_date && start_date > date
1119 if start_date && start_date > date
1077 # Issue can not be moved earlier than its soonest start date
1120 # Issue can not be moved earlier than its soonest start date
1078 date = [soonest_start(true), date].compact.max
1121 date = [soonest_start(true), date].compact.max
1079 end
1122 end
1080 reschedule_on(date)
1123 reschedule_on(date)
1081 begin
1124 begin
1082 save
1125 save
1083 rescue ActiveRecord::StaleObjectError
1126 rescue ActiveRecord::StaleObjectError
1084 reload
1127 reload
1085 reschedule_on(date)
1128 reschedule_on(date)
1086 save
1129 save
1087 end
1130 end
1088 end
1131 end
1089 else
1132 else
1090 leaves.each do |leaf|
1133 leaves.each do |leaf|
1091 if leaf.start_date
1134 if leaf.start_date
1092 # Only move subtask if it starts at the same date as the parent
1135 # Only move subtask if it starts at the same date as the parent
1093 # or if it starts before the given date
1136 # or if it starts before the given date
1094 if start_date == leaf.start_date || date > leaf.start_date
1137 if start_date == leaf.start_date || date > leaf.start_date
1095 leaf.reschedule_on!(date)
1138 leaf.reschedule_on!(date)
1096 end
1139 end
1097 else
1140 else
1098 leaf.reschedule_on!(date)
1141 leaf.reschedule_on!(date)
1099 end
1142 end
1100 end
1143 end
1101 end
1144 end
1102 end
1145 end
1103
1146
1104 def <=>(issue)
1147 def <=>(issue)
1105 if issue.nil?
1148 if issue.nil?
1106 -1
1149 -1
1107 elsif root_id != issue.root_id
1150 elsif root_id != issue.root_id
1108 (root_id || 0) <=> (issue.root_id || 0)
1151 (root_id || 0) <=> (issue.root_id || 0)
1109 else
1152 else
1110 (lft || 0) <=> (issue.lft || 0)
1153 (lft || 0) <=> (issue.lft || 0)
1111 end
1154 end
1112 end
1155 end
1113
1156
1114 def to_s
1157 def to_s
1115 "#{tracker} ##{id}: #{subject}"
1158 "#{tracker} ##{id}: #{subject}"
1116 end
1159 end
1117
1160
1118 # Returns a string of css classes that apply to the issue
1161 # Returns a string of css classes that apply to the issue
1119 def css_classes(user=User.current)
1162 def css_classes(user=User.current)
1120 s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
1163 s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
1121 s << ' closed' if closed?
1164 s << ' closed' if closed?
1122 s << ' overdue' if overdue?
1165 s << ' overdue' if overdue?
1123 s << ' child' if child?
1166 s << ' child' if child?
1124 s << ' parent' unless leaf?
1167 s << ' parent' unless leaf?
1125 s << ' private' if is_private?
1168 s << ' private' if is_private?
1126 if user.logged?
1169 if user.logged?
1127 s << ' created-by-me' if author_id == user.id
1170 s << ' created-by-me' if author_id == user.id
1128 s << ' assigned-to-me' if assigned_to_id == user.id
1171 s << ' assigned-to-me' if assigned_to_id == user.id
1129 s << ' assigned-to-my-group' if user.groups.any? {|g| g.id == assigned_to_id}
1172 s << ' assigned-to-my-group' if user.groups.any? {|g| g.id == assigned_to_id}
1130 end
1173 end
1131 s
1174 s
1132 end
1175 end
1133
1176
1134 # Unassigns issues from +version+ if it's no longer shared with issue's project
1177 # Unassigns issues from +version+ if it's no longer shared with issue's project
1135 def self.update_versions_from_sharing_change(version)
1178 def self.update_versions_from_sharing_change(version)
1136 # Update issues assigned to the version
1179 # Update issues assigned to the version
1137 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
1180 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
1138 end
1181 end
1139
1182
1140 # Unassigns issues from versions that are no longer shared
1183 # Unassigns issues from versions that are no longer shared
1141 # after +project+ was moved
1184 # after +project+ was moved
1142 def self.update_versions_from_hierarchy_change(project)
1185 def self.update_versions_from_hierarchy_change(project)
1143 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
1186 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
1144 # Update issues of the moved projects and issues assigned to a version of a moved project
1187 # Update issues of the moved projects and issues assigned to a version of a moved project
1145 Issue.update_versions(
1188 Issue.update_versions(
1146 ["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)",
1189 ["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)",
1147 moved_project_ids, moved_project_ids]
1190 moved_project_ids, moved_project_ids]
1148 )
1191 )
1149 end
1192 end
1150
1193
1151 def parent_issue_id=(arg)
1194 def parent_issue_id=(arg)
1152 s = arg.to_s.strip.presence
1195 s = arg.to_s.strip.presence
1153 if s && (m = s.match(%r{\A#?(\d+)\z})) && (@parent_issue = Issue.find_by_id(m[1]))
1196 if s && (m = s.match(%r{\A#?(\d+)\z})) && (@parent_issue = Issue.find_by_id(m[1]))
1154 @invalid_parent_issue_id = nil
1197 @invalid_parent_issue_id = nil
1155 elsif s.blank?
1198 elsif s.blank?
1156 @parent_issue = nil
1199 @parent_issue = nil
1157 @invalid_parent_issue_id = nil
1200 @invalid_parent_issue_id = nil
1158 else
1201 else
1159 @parent_issue = nil
1202 @parent_issue = nil
1160 @invalid_parent_issue_id = arg
1203 @invalid_parent_issue_id = arg
1161 end
1204 end
1162 end
1205 end
1163
1206
1164 def parent_issue_id
1207 def parent_issue_id
1165 if @invalid_parent_issue_id
1208 if @invalid_parent_issue_id
1166 @invalid_parent_issue_id
1209 @invalid_parent_issue_id
1167 elsif instance_variable_defined? :@parent_issue
1210 elsif instance_variable_defined? :@parent_issue
1168 @parent_issue.nil? ? nil : @parent_issue.id
1211 @parent_issue.nil? ? nil : @parent_issue.id
1169 else
1212 else
1170 parent_id
1213 parent_id
1171 end
1214 end
1172 end
1215 end
1173
1216
1174 # Returns true if issue's project is a valid
1217 # Returns true if issue's project is a valid
1175 # parent issue project
1218 # parent issue project
1176 def valid_parent_project?(issue=parent)
1219 def valid_parent_project?(issue=parent)
1177 return true if issue.nil? || issue.project_id == project_id
1220 return true if issue.nil? || issue.project_id == project_id
1178
1221
1179 case Setting.cross_project_subtasks
1222 case Setting.cross_project_subtasks
1180 when 'system'
1223 when 'system'
1181 true
1224 true
1182 when 'tree'
1225 when 'tree'
1183 issue.project.root == project.root
1226 issue.project.root == project.root
1184 when 'hierarchy'
1227 when 'hierarchy'
1185 issue.project.is_or_is_ancestor_of?(project) || issue.project.is_descendant_of?(project)
1228 issue.project.is_or_is_ancestor_of?(project) || issue.project.is_descendant_of?(project)
1186 when 'descendants'
1229 when 'descendants'
1187 issue.project.is_or_is_ancestor_of?(project)
1230 issue.project.is_or_is_ancestor_of?(project)
1188 else
1231 else
1189 false
1232 false
1190 end
1233 end
1191 end
1234 end
1192
1235
1193 # Returns an issue scope based on project and scope
1236 # Returns an issue scope based on project and scope
1194 def self.cross_project_scope(project, scope=nil)
1237 def self.cross_project_scope(project, scope=nil)
1195 if project.nil?
1238 if project.nil?
1196 return Issue
1239 return Issue
1197 end
1240 end
1198 case scope
1241 case scope
1199 when 'all', 'system'
1242 when 'all', 'system'
1200 Issue
1243 Issue
1201 when 'tree'
1244 when 'tree'
1202 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt)",
1245 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt)",
1203 :lft => project.root.lft, :rgt => project.root.rgt)
1246 :lft => project.root.lft, :rgt => project.root.rgt)
1204 when 'hierarchy'
1247 when 'hierarchy'
1205 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt) OR (#{Project.table_name}.lft < :lft AND #{Project.table_name}.rgt > :rgt)",
1248 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt) OR (#{Project.table_name}.lft < :lft AND #{Project.table_name}.rgt > :rgt)",
1206 :lft => project.lft, :rgt => project.rgt)
1249 :lft => project.lft, :rgt => project.rgt)
1207 when 'descendants'
1250 when 'descendants'
1208 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt)",
1251 Issue.joins(:project).where("(#{Project.table_name}.lft >= :lft AND #{Project.table_name}.rgt <= :rgt)",
1209 :lft => project.lft, :rgt => project.rgt)
1252 :lft => project.lft, :rgt => project.rgt)
1210 else
1253 else
1211 Issue.where(:project_id => project.id)
1254 Issue.where(:project_id => project.id)
1212 end
1255 end
1213 end
1256 end
1214
1257
1215 def self.by_tracker(project)
1258 def self.by_tracker(project)
1216 count_and_group_by(:project => project, :association => :tracker)
1259 count_and_group_by(:project => project, :association => :tracker)
1217 end
1260 end
1218
1261
1219 def self.by_version(project)
1262 def self.by_version(project)
1220 count_and_group_by(:project => project, :association => :fixed_version)
1263 count_and_group_by(:project => project, :association => :fixed_version)
1221 end
1264 end
1222
1265
1223 def self.by_priority(project)
1266 def self.by_priority(project)
1224 count_and_group_by(:project => project, :association => :priority)
1267 count_and_group_by(:project => project, :association => :priority)
1225 end
1268 end
1226
1269
1227 def self.by_category(project)
1270 def self.by_category(project)
1228 count_and_group_by(:project => project, :association => :category)
1271 count_and_group_by(:project => project, :association => :category)
1229 end
1272 end
1230
1273
1231 def self.by_assigned_to(project)
1274 def self.by_assigned_to(project)
1232 count_and_group_by(:project => project, :association => :assigned_to)
1275 count_and_group_by(:project => project, :association => :assigned_to)
1233 end
1276 end
1234
1277
1235 def self.by_author(project)
1278 def self.by_author(project)
1236 count_and_group_by(:project => project, :association => :author)
1279 count_and_group_by(:project => project, :association => :author)
1237 end
1280 end
1238
1281
1239 def self.by_subproject(project)
1282 def self.by_subproject(project)
1240 r = count_and_group_by(:project => project, :with_subprojects => true, :association => :project)
1283 r = count_and_group_by(:project => project, :with_subprojects => true, :association => :project)
1241 r.reject {|r| r["project_id"] == project.id.to_s}
1284 r.reject {|r| r["project_id"] == project.id.to_s}
1242 end
1285 end
1243
1286
1244 # Query generator for selecting groups of issue counts for a project
1287 # Query generator for selecting groups of issue counts for a project
1245 # based on specific criteria
1288 # based on specific criteria
1246 #
1289 #
1247 # Options
1290 # Options
1248 # * project - Project to search in.
1291 # * project - Project to search in.
1249 # * with_subprojects - Includes subprojects issues if set to true.
1292 # * with_subprojects - Includes subprojects issues if set to true.
1250 # * association - Symbol. Association for grouping.
1293 # * association - Symbol. Association for grouping.
1251 def self.count_and_group_by(options)
1294 def self.count_and_group_by(options)
1252 assoc = reflect_on_association(options[:association])
1295 assoc = reflect_on_association(options[:association])
1253 select_field = assoc.foreign_key
1296 select_field = assoc.foreign_key
1254
1297
1255 Issue.
1298 Issue.
1256 visible(User.current, :project => options[:project], :with_subprojects => options[:with_subprojects]).
1299 visible(User.current, :project => options[:project], :with_subprojects => options[:with_subprojects]).
1257 joins(:status, assoc.name).
1300 joins(:status, assoc.name).
1258 group(:status_id, :is_closed, select_field).
1301 group(:status_id, :is_closed, select_field).
1259 count.
1302 count.
1260 map do |columns, total|
1303 map do |columns, total|
1261 status_id, is_closed, field_value = columns
1304 status_id, is_closed, field_value = columns
1262 is_closed = ['t', 'true', '1'].include?(is_closed.to_s)
1305 is_closed = ['t', 'true', '1'].include?(is_closed.to_s)
1263 {
1306 {
1264 "status_id" => status_id.to_s,
1307 "status_id" => status_id.to_s,
1265 "closed" => is_closed,
1308 "closed" => is_closed,
1266 select_field => field_value.to_s,
1309 select_field => field_value.to_s,
1267 "total" => total.to_s
1310 "total" => total.to_s
1268 }
1311 }
1269 end
1312 end
1270 end
1313 end
1271
1314
1272 # Returns a scope of projects that user can assign the issue to
1315 # Returns a scope of projects that user can assign the issue to
1273 def allowed_target_projects(user=User.current)
1316 def allowed_target_projects(user=User.current)
1274 if new_record?
1317 if new_record?
1275 Project.where(Project.allowed_to_condition(user, :add_issues))
1318 Project.where(Project.allowed_to_condition(user, :add_issues))
1276 else
1319 else
1277 self.class.allowed_target_projects_on_move(user)
1320 self.class.allowed_target_projects_on_move(user)
1278 end
1321 end
1279 end
1322 end
1280
1323
1281 # Returns a scope of projects that user can move issues to
1324 # Returns a scope of projects that user can move issues to
1282 def self.allowed_target_projects_on_move(user=User.current)
1325 def self.allowed_target_projects_on_move(user=User.current)
1283 Project.where(Project.allowed_to_condition(user, :move_issues))
1326 Project.where(Project.allowed_to_condition(user, :move_issues))
1284 end
1327 end
1285
1328
1286 private
1329 private
1287
1330
1288 def after_project_change
1331 def after_project_change
1289 # Update project_id on related time entries
1332 # Update project_id on related time entries
1290 TimeEntry.where({:issue_id => id}).update_all(["project_id = ?", project_id])
1333 TimeEntry.where({:issue_id => id}).update_all(["project_id = ?", project_id])
1291
1334
1292 # Delete issue relations
1335 # Delete issue relations
1293 unless Setting.cross_project_issue_relations?
1336 unless Setting.cross_project_issue_relations?
1294 relations_from.clear
1337 relations_from.clear
1295 relations_to.clear
1338 relations_to.clear
1296 end
1339 end
1297
1340
1298 # Move subtasks that were in the same project
1341 # Move subtasks that were in the same project
1299 children.each do |child|
1342 children.each do |child|
1300 next unless child.project_id == project_id_was
1343 next unless child.project_id == project_id_was
1301 # Change project and keep project
1344 # Change project and keep project
1302 child.send :project=, project, true
1345 child.send :project=, project, true
1303 unless child.save
1346 unless child.save
1304 raise ActiveRecord::Rollback
1347 raise ActiveRecord::Rollback
1305 end
1348 end
1306 end
1349 end
1307 end
1350 end
1308
1351
1309 # Callback for after the creation of an issue by copy
1352 # Callback for after the creation of an issue by copy
1310 # * adds a "copied to" relation with the copied issue
1353 # * adds a "copied to" relation with the copied issue
1311 # * copies subtasks from the copied issue
1354 # * copies subtasks from the copied issue
1312 def after_create_from_copy
1355 def after_create_from_copy
1313 return unless copy? && !@after_create_from_copy_handled
1356 return unless copy? && !@after_create_from_copy_handled
1314
1357
1315 if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
1358 if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
1316 if @current_journal
1359 if @current_journal
1317 @copied_from.init_journal(@current_journal.user)
1360 @copied_from.init_journal(@current_journal.user)
1318 end
1361 end
1319 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1362 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1320 unless relation.save
1363 unless relation.save
1321 logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
1364 logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
1322 end
1365 end
1323 end
1366 end
1324
1367
1325 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1368 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1326 copy_options = (@copy_options || {}).merge(:subtasks => false)
1369 copy_options = (@copy_options || {}).merge(:subtasks => false)
1327 copied_issue_ids = {@copied_from.id => self.id}
1370 copied_issue_ids = {@copied_from.id => self.id}
1328 @copied_from.reload.descendants.reorder("#{Issue.table_name}.lft").each do |child|
1371 @copied_from.reload.descendants.reorder("#{Issue.table_name}.lft").each do |child|
1329 # Do not copy self when copying an issue as a descendant of the copied issue
1372 # Do not copy self when copying an issue as a descendant of the copied issue
1330 next if child == self
1373 next if child == self
1331 # Do not copy subtasks of issues that were not copied
1374 # Do not copy subtasks of issues that were not copied
1332 next unless copied_issue_ids[child.parent_id]
1375 next unless copied_issue_ids[child.parent_id]
1333 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1376 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1334 unless child.visible?
1377 unless child.visible?
1335 logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
1378 logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
1336 next
1379 next
1337 end
1380 end
1338 copy = Issue.new.copy_from(child, copy_options)
1381 copy = Issue.new.copy_from(child, copy_options)
1339 if @current_journal
1382 if @current_journal
1340 copy.init_journal(@current_journal.user)
1383 copy.init_journal(@current_journal.user)
1341 end
1384 end
1342 copy.author = author
1385 copy.author = author
1343 copy.project = project
1386 copy.project = project
1344 copy.parent_issue_id = copied_issue_ids[child.parent_id]
1387 copy.parent_issue_id = copied_issue_ids[child.parent_id]
1345 unless copy.save
1388 unless copy.save
1346 logger.error "Could not copy subtask ##{child.id} while copying ##{@copied_from.id} to ##{id} due to validation errors: #{copy.errors.full_messages.join(', ')}" if logger
1389 logger.error "Could not copy subtask ##{child.id} while copying ##{@copied_from.id} to ##{id} due to validation errors: #{copy.errors.full_messages.join(', ')}" if logger
1347 next
1390 next
1348 end
1391 end
1349 copied_issue_ids[child.id] = copy.id
1392 copied_issue_ids[child.id] = copy.id
1350 end
1393 end
1351 end
1394 end
1352 @after_create_from_copy_handled = true
1395 @after_create_from_copy_handled = true
1353 end
1396 end
1354
1397
1355 def update_nested_set_attributes
1398 def update_nested_set_attributes
1356 if root_id.nil?
1399 if root_id.nil?
1357 # issue was just created
1400 # issue was just created
1358 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1401 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1359 Issue.where(["id = ?", id]).update_all(["root_id = ?", root_id])
1402 Issue.where(["id = ?", id]).update_all(["root_id = ?", root_id])
1360 if @parent_issue
1403 if @parent_issue
1361 move_to_child_of(@parent_issue)
1404 move_to_child_of(@parent_issue)
1362 end
1405 end
1363 elsif parent_issue_id != parent_id
1406 elsif parent_issue_id != parent_id
1364 update_nested_set_attributes_on_parent_change
1407 update_nested_set_attributes_on_parent_change
1365 end
1408 end
1366 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1409 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1367 end
1410 end
1368
1411
1369 # Updates the nested set for when an existing issue is moved
1412 # Updates the nested set for when an existing issue is moved
1370 def update_nested_set_attributes_on_parent_change
1413 def update_nested_set_attributes_on_parent_change
1371 former_parent_id = parent_id
1414 former_parent_id = parent_id
1372 # moving an existing issue
1415 # moving an existing issue
1373 if @parent_issue && @parent_issue.root_id == root_id
1416 if @parent_issue && @parent_issue.root_id == root_id
1374 # inside the same tree
1417 # inside the same tree
1375 move_to_child_of(@parent_issue)
1418 move_to_child_of(@parent_issue)
1376 else
1419 else
1377 # to another tree
1420 # to another tree
1378 unless root?
1421 unless root?
1379 move_to_right_of(root)
1422 move_to_right_of(root)
1380 end
1423 end
1381 old_root_id = root_id
1424 old_root_id = root_id
1382 in_tenacious_transaction do
1425 in_tenacious_transaction do
1383 @parent_issue.reload_nested_set if @parent_issue
1426 @parent_issue.reload_nested_set if @parent_issue
1384 self.reload_nested_set
1427 self.reload_nested_set
1385 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1428 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1386 cond = ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt]
1429 cond = ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt]
1387 self.class.base_class.select('id').lock(true).where(cond)
1430 self.class.base_class.select('id').lock(true).where(cond)
1388 offset = rdm_right_most_bound + 1 - lft
1431 offset = rdm_right_most_bound + 1 - lft
1389 Issue.where(cond).
1432 Issue.where(cond).
1390 update_all(["root_id = ?, lft = lft + ?, rgt = rgt + ?", root_id, offset, offset])
1433 update_all(["root_id = ?, lft = lft + ?, rgt = rgt + ?", root_id, offset, offset])
1391 end
1434 end
1392 if @parent_issue
1435 if @parent_issue
1393 move_to_child_of(@parent_issue)
1436 move_to_child_of(@parent_issue)
1394 end
1437 end
1395 end
1438 end
1396 # delete invalid relations of all descendants
1439 # delete invalid relations of all descendants
1397 self_and_descendants.each do |issue|
1440 self_and_descendants.each do |issue|
1398 issue.relations.each do |relation|
1441 issue.relations.each do |relation|
1399 relation.destroy unless relation.valid?
1442 relation.destroy unless relation.valid?
1400 end
1443 end
1401 end
1444 end
1402 # update former parent
1445 # update former parent
1403 recalculate_attributes_for(former_parent_id) if former_parent_id
1446 recalculate_attributes_for(former_parent_id) if former_parent_id
1404 end
1447 end
1405
1448
1406 def rdm_right_most_bound
1449 def rdm_right_most_bound
1407 right_most_node =
1450 right_most_node =
1408 self.class.base_class.unscoped.
1451 self.class.base_class.unscoped.
1409 order("#{quoted_right_column_full_name} desc").limit(1).lock(true).first
1452 order("#{quoted_right_column_full_name} desc").limit(1).lock(true).first
1410 right_most_node ? (right_most_node[right_column_name] || 0 ) : 0
1453 right_most_node ? (right_most_node[right_column_name] || 0 ) : 0
1411 end
1454 end
1412 private :rdm_right_most_bound
1455 private :rdm_right_most_bound
1413
1456
1414 def update_parent_attributes
1457 def update_parent_attributes
1415 recalculate_attributes_for(parent_id) if parent_id
1458 recalculate_attributes_for(parent_id) if parent_id
1416 end
1459 end
1417
1460
1418 def recalculate_attributes_for(issue_id)
1461 def recalculate_attributes_for(issue_id)
1419 if issue_id && p = Issue.find_by_id(issue_id)
1462 if issue_id && p = Issue.find_by_id(issue_id)
1420 # priority = highest priority of children
1463 # priority = highest priority of children
1421 if priority_position = p.children.joins(:priority).maximum("#{IssuePriority.table_name}.position")
1464 if priority_position = p.children.joins(:priority).maximum("#{IssuePriority.table_name}.position")
1422 p.priority = IssuePriority.find_by_position(priority_position)
1465 p.priority = IssuePriority.find_by_position(priority_position)
1423 end
1466 end
1424
1467
1425 # start/due dates = lowest/highest dates of children
1468 # start/due dates = lowest/highest dates of children
1426 p.start_date = p.children.minimum(:start_date)
1469 p.start_date = p.children.minimum(:start_date)
1427 p.due_date = p.children.maximum(:due_date)
1470 p.due_date = p.children.maximum(:due_date)
1428 if p.start_date && p.due_date && p.due_date < p.start_date
1471 if p.start_date && p.due_date && p.due_date < p.start_date
1429 p.start_date, p.due_date = p.due_date, p.start_date
1472 p.start_date, p.due_date = p.due_date, p.start_date
1430 end
1473 end
1431
1474
1432 # done ratio = weighted average ratio of leaves
1475 # done ratio = weighted average ratio of leaves
1433 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1476 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1434 leaves_count = p.leaves.count
1477 leaves_count = p.leaves.count
1435 if leaves_count > 0
1478 if leaves_count > 0
1436 average = p.leaves.where("estimated_hours > 0").average(:estimated_hours).to_f
1479 average = p.leaves.where("estimated_hours > 0").average(:estimated_hours).to_f
1437 if average == 0
1480 if average == 0
1438 average = 1
1481 average = 1
1439 end
1482 end
1440 done = p.leaves.joins(:status).
1483 done = p.leaves.joins(:status).
1441 sum("COALESCE(CASE WHEN estimated_hours > 0 THEN estimated_hours ELSE NULL END, #{average}) " +
1484 sum("COALESCE(CASE WHEN estimated_hours > 0 THEN estimated_hours ELSE NULL END, #{average}) " +
1442 "* (CASE WHEN is_closed = #{self.class.connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)").to_f
1485 "* (CASE WHEN is_closed = #{self.class.connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)").to_f
1443 progress = done / (average * leaves_count)
1486 progress = done / (average * leaves_count)
1444 p.done_ratio = progress.round
1487 p.done_ratio = progress.round
1445 end
1488 end
1446 end
1489 end
1447
1490
1448 # estimate = sum of leaves estimates
1491 # estimate = sum of leaves estimates
1449 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1492 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1450 p.estimated_hours = nil if p.estimated_hours == 0.0
1493 p.estimated_hours = nil if p.estimated_hours == 0.0
1451
1494
1452 # ancestors will be recursively updated
1495 # ancestors will be recursively updated
1453 p.save(:validate => false)
1496 p.save(:validate => false)
1454 end
1497 end
1455 end
1498 end
1456
1499
1457 # Update issues so their versions are not pointing to a
1500 # Update issues so their versions are not pointing to a
1458 # fixed_version that is not shared with the issue's project
1501 # fixed_version that is not shared with the issue's project
1459 def self.update_versions(conditions=nil)
1502 def self.update_versions(conditions=nil)
1460 # Only need to update issues with a fixed_version from
1503 # Only need to update issues with a fixed_version from
1461 # a different project and that is not systemwide shared
1504 # a different project and that is not systemwide shared
1462 Issue.joins(:project, :fixed_version).
1505 Issue.joins(:project, :fixed_version).
1463 where("#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1506 where("#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1464 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1507 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1465 " AND #{Version.table_name}.sharing <> 'system'").
1508 " AND #{Version.table_name}.sharing <> 'system'").
1466 where(conditions).each do |issue|
1509 where(conditions).each do |issue|
1467 next if issue.project.nil? || issue.fixed_version.nil?
1510 next if issue.project.nil? || issue.fixed_version.nil?
1468 unless issue.project.shared_versions.include?(issue.fixed_version)
1511 unless issue.project.shared_versions.include?(issue.fixed_version)
1469 issue.init_journal(User.current)
1512 issue.init_journal(User.current)
1470 issue.fixed_version = nil
1513 issue.fixed_version = nil
1471 issue.save
1514 issue.save
1472 end
1515 end
1473 end
1516 end
1474 end
1517 end
1475
1518
1476 # Callback on file attachment
1519 # Callback on file attachment
1477 def attachment_added(obj)
1520 def attachment_added(obj)
1478 if @current_journal && !obj.new_record?
1521 if @current_journal && !obj.new_record?
1479 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1522 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1480 end
1523 end
1481 end
1524 end
1482
1525
1483 # Callback on attachment deletion
1526 # Callback on attachment deletion
1484 def attachment_removed(obj)
1527 def attachment_removed(obj)
1485 if @current_journal && !obj.new_record?
1528 if @current_journal && !obj.new_record?
1486 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1529 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1487 @current_journal.save
1530 @current_journal.save
1488 end
1531 end
1489 end
1532 end
1490
1533
1491 # Called after a relation is added
1534 # Called after a relation is added
1492 def relation_added(relation)
1535 def relation_added(relation)
1493 if @current_journal
1536 if @current_journal
1494 @current_journal.details << JournalDetail.new(
1537 @current_journal.details << JournalDetail.new(
1495 :property => 'relation',
1538 :property => 'relation',
1496 :prop_key => relation.relation_type_for(self),
1539 :prop_key => relation.relation_type_for(self),
1497 :value => relation.other_issue(self).try(:id)
1540 :value => relation.other_issue(self).try(:id)
1498 )
1541 )
1499 @current_journal.save
1542 @current_journal.save
1500 end
1543 end
1501 end
1544 end
1502
1545
1503 # Called after a relation is removed
1546 # Called after a relation is removed
1504 def relation_removed(relation)
1547 def relation_removed(relation)
1505 if @current_journal
1548 if @current_journal
1506 @current_journal.details << JournalDetail.new(
1549 @current_journal.details << JournalDetail.new(
1507 :property => 'relation',
1550 :property => 'relation',
1508 :prop_key => relation.relation_type_for(self),
1551 :prop_key => relation.relation_type_for(self),
1509 :old_value => relation.other_issue(self).try(:id)
1552 :old_value => relation.other_issue(self).try(:id)
1510 )
1553 )
1511 @current_journal.save
1554 @current_journal.save
1512 end
1555 end
1513 end
1556 end
1514
1557
1515 # Default assignment based on category
1558 # Default assignment based on category
1516 def default_assign
1559 def default_assign
1517 if assigned_to.nil? && category && category.assigned_to
1560 if assigned_to.nil? && category && category.assigned_to
1518 self.assigned_to = category.assigned_to
1561 self.assigned_to = category.assigned_to
1519 end
1562 end
1520 end
1563 end
1521
1564
1522 # Updates start/due dates of following issues
1565 # Updates start/due dates of following issues
1523 def reschedule_following_issues
1566 def reschedule_following_issues
1524 if start_date_changed? || due_date_changed?
1567 if start_date_changed? || due_date_changed?
1525 relations_from.each do |relation|
1568 relations_from.each do |relation|
1526 relation.set_issue_to_dates
1569 relation.set_issue_to_dates
1527 end
1570 end
1528 end
1571 end
1529 end
1572 end
1530
1573
1531 # Closes duplicates if the issue is being closed
1574 # Closes duplicates if the issue is being closed
1532 def close_duplicates
1575 def close_duplicates
1533 if closing?
1576 if closing?
1534 duplicates.each do |duplicate|
1577 duplicates.each do |duplicate|
1535 # Reload is needed in case the duplicate was updated by a previous duplicate
1578 # Reload is needed in case the duplicate was updated by a previous duplicate
1536 duplicate.reload
1579 duplicate.reload
1537 # Don't re-close it if it's already closed
1580 # Don't re-close it if it's already closed
1538 next if duplicate.closed?
1581 next if duplicate.closed?
1539 # Same user and notes
1582 # Same user and notes
1540 if @current_journal
1583 if @current_journal
1541 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1584 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1542 end
1585 end
1543 duplicate.update_attribute :status, self.status
1586 duplicate.update_attribute :status, self.status
1544 end
1587 end
1545 end
1588 end
1546 end
1589 end
1547
1590
1548 # Make sure updated_on is updated when adding a note and set updated_on now
1591 # Make sure updated_on is updated when adding a note and set updated_on now
1549 # so we can set closed_on with the same value on closing
1592 # so we can set closed_on with the same value on closing
1550 def force_updated_on_change
1593 def force_updated_on_change
1551 if @current_journal || changed?
1594 if @current_journal || changed?
1552 self.updated_on = current_time_from_proper_timezone
1595 self.updated_on = current_time_from_proper_timezone
1553 if new_record?
1596 if new_record?
1554 self.created_on = updated_on
1597 self.created_on = updated_on
1555 end
1598 end
1556 end
1599 end
1557 end
1600 end
1558
1601
1559 # Callback for setting closed_on when the issue is closed.
1602 # Callback for setting closed_on when the issue is closed.
1560 # The closed_on attribute stores the time of the last closing
1603 # The closed_on attribute stores the time of the last closing
1561 # and is preserved when the issue is reopened.
1604 # and is preserved when the issue is reopened.
1562 def update_closed_on
1605 def update_closed_on
1563 if closing?
1606 if closing?
1564 self.closed_on = updated_on
1607 self.closed_on = updated_on
1565 end
1608 end
1566 end
1609 end
1567
1610
1568 # Saves the changes in a Journal
1611 # Saves the changes in a Journal
1569 # Called after_save
1612 # Called after_save
1570 def create_journal
1613 def create_journal
1571 if @current_journal
1614 if @current_journal
1572 # attributes changes
1615 # attributes changes
1573 if @attributes_before_change
1616 if @attributes_before_change
1574 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on closed_on)).each {|c|
1617 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on closed_on)).each {|c|
1575 before = @attributes_before_change[c]
1618 before = @attributes_before_change[c]
1576 after = send(c)
1619 after = send(c)
1577 next if before == after || (before.blank? && after.blank?)
1620 next if before == after || (before.blank? && after.blank?)
1578 @current_journal.details << JournalDetail.new(:property => 'attr',
1621 @current_journal.details << JournalDetail.new(:property => 'attr',
1579 :prop_key => c,
1622 :prop_key => c,
1580 :old_value => before,
1623 :old_value => before,
1581 :value => after)
1624 :value => after)
1582 }
1625 }
1583 end
1626 end
1584 if @custom_values_before_change
1627 if @custom_values_before_change
1585 # custom fields changes
1628 # custom fields changes
1586 custom_field_values.each {|c|
1629 custom_field_values.each {|c|
1587 before = @custom_values_before_change[c.custom_field_id]
1630 before = @custom_values_before_change[c.custom_field_id]
1588 after = c.value
1631 after = c.value
1589 next if before == after || (before.blank? && after.blank?)
1632 next if before == after || (before.blank? && after.blank?)
1590
1633
1591 if before.is_a?(Array) || after.is_a?(Array)
1634 if before.is_a?(Array) || after.is_a?(Array)
1592 before = [before] unless before.is_a?(Array)
1635 before = [before] unless before.is_a?(Array)
1593 after = [after] unless after.is_a?(Array)
1636 after = [after] unless after.is_a?(Array)
1594
1637
1595 # values removed
1638 # values removed
1596 (before - after).reject(&:blank?).each do |value|
1639 (before - after).reject(&:blank?).each do |value|
1597 @current_journal.details << JournalDetail.new(:property => 'cf',
1640 @current_journal.details << JournalDetail.new(:property => 'cf',
1598 :prop_key => c.custom_field_id,
1641 :prop_key => c.custom_field_id,
1599 :old_value => value,
1642 :old_value => value,
1600 :value => nil)
1643 :value => nil)
1601 end
1644 end
1602 # values added
1645 # values added
1603 (after - before).reject(&:blank?).each do |value|
1646 (after - before).reject(&:blank?).each do |value|
1604 @current_journal.details << JournalDetail.new(:property => 'cf',
1647 @current_journal.details << JournalDetail.new(:property => 'cf',
1605 :prop_key => c.custom_field_id,
1648 :prop_key => c.custom_field_id,
1606 :old_value => nil,
1649 :old_value => nil,
1607 :value => value)
1650 :value => value)
1608 end
1651 end
1609 else
1652 else
1610 @current_journal.details << JournalDetail.new(:property => 'cf',
1653 @current_journal.details << JournalDetail.new(:property => 'cf',
1611 :prop_key => c.custom_field_id,
1654 :prop_key => c.custom_field_id,
1612 :old_value => before,
1655 :old_value => before,
1613 :value => after)
1656 :value => after)
1614 end
1657 end
1615 }
1658 }
1616 end
1659 end
1617 @current_journal.save
1660 @current_journal.save
1618 # reset current journal
1661 # reset current journal
1619 init_journal @current_journal.user, @current_journal.notes
1662 init_journal @current_journal.user, @current_journal.notes
1620 end
1663 end
1621 end
1664 end
1622
1665
1623 def send_notification
1666 def send_notification
1624 if Setting.notified_events.include?('issue_added')
1667 if Setting.notified_events.include?('issue_added')
1625 Mailer.deliver_issue_add(self)
1668 Mailer.deliver_issue_add(self)
1626 end
1669 end
1627 end
1670 end
1628
1671
1629 # Stores the previous assignee so we can still have access
1672 # Stores the previous assignee so we can still have access
1630 # to it during after_save callbacks (assigned_to_id_was is reset)
1673 # to it during after_save callbacks (assigned_to_id_was is reset)
1631 def set_assigned_to_was
1674 def set_assigned_to_was
1632 @previous_assigned_to_id = assigned_to_id_was
1675 @previous_assigned_to_id = assigned_to_id_was
1633 end
1676 end
1634
1677
1635 # Clears the previous assignee at the end of after_save callbacks
1678 # Clears the previous assignee at the end of after_save callbacks
1636 def clear_assigned_to_was
1679 def clear_assigned_to_was
1637 @assigned_to_was = nil
1680 @assigned_to_was = nil
1638 @previous_assigned_to_id = nil
1681 @previous_assigned_to_id = nil
1639 end
1682 end
1640 end
1683 end
@@ -1,110 +1,104
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class IssueStatus < ActiveRecord::Base
18 class IssueStatus < ActiveRecord::Base
19 before_destroy :check_integrity
19 before_destroy :check_integrity
20 has_many :workflows, :class_name => 'WorkflowTransition', :foreign_key => "old_status_id"
20 has_many :workflows, :class_name => 'WorkflowTransition', :foreign_key => "old_status_id"
21 has_many :workflow_transitions_as_new_status, :class_name => 'WorkflowTransition', :foreign_key => "new_status_id"
21 has_many :workflow_transitions_as_new_status, :class_name => 'WorkflowTransition', :foreign_key => "new_status_id"
22 acts_as_list
22 acts_as_list
23
23
24 before_destroy :delete_workflow_rules
24 before_destroy :delete_workflow_rules
25 after_save :update_default
26
25
27 validates_presence_of :name
26 validates_presence_of :name
28 validates_uniqueness_of :name
27 validates_uniqueness_of :name
29 validates_length_of :name, :maximum => 30
28 validates_length_of :name, :maximum => 30
30 validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
29 validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
31 attr_protected :id
30 attr_protected :id
32
31
33 scope :sorted, lambda { order(:position) }
32 scope :sorted, lambda { order(:position) }
34 scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
33 scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
35
34
36 def update_default
37 IssueStatus.where(['id <> ?', id]).update_all({:is_default => false}) if self.is_default?
38 end
39
40 # Returns the default status for new issues
41 def self.default
42 where(:is_default => true).first
43 end
44
45 # Update all the +Issues+ setting their done_ratio to the value of their +IssueStatus+
35 # Update all the +Issues+ setting their done_ratio to the value of their +IssueStatus+
46 def self.update_issue_done_ratios
36 def self.update_issue_done_ratios
47 if Issue.use_status_for_done_ratio?
37 if Issue.use_status_for_done_ratio?
48 IssueStatus.where("default_done_ratio >= 0").each do |status|
38 IssueStatus.where("default_done_ratio >= 0").each do |status|
49 Issue.where({:status_id => status.id}).update_all({:done_ratio => status.default_done_ratio})
39 Issue.where({:status_id => status.id}).update_all({:done_ratio => status.default_done_ratio})
50 end
40 end
51 end
41 end
52
42
53 return Issue.use_status_for_done_ratio?
43 return Issue.use_status_for_done_ratio?
54 end
44 end
55
45
56 # Returns an array of all statuses the given role can switch to
46 # Returns an array of all statuses the given role can switch to
57 # Uses association cache when called more than one time
47 # Uses association cache when called more than one time
58 def new_statuses_allowed_to(roles, tracker, author=false, assignee=false)
48 def new_statuses_allowed_to(roles, tracker, author=false, assignee=false)
59 if roles && tracker
49 if roles && tracker
60 role_ids = roles.collect(&:id)
50 role_ids = roles.collect(&:id)
61 transitions = workflows.select do |w|
51 transitions = workflows.select do |w|
62 role_ids.include?(w.role_id) &&
52 role_ids.include?(w.role_id) &&
63 w.tracker_id == tracker.id &&
53 w.tracker_id == tracker.id &&
64 ((!w.author && !w.assignee) || (author && w.author) || (assignee && w.assignee))
54 ((!w.author && !w.assignee) || (author && w.author) || (assignee && w.assignee))
65 end
55 end
66 transitions.map(&:new_status).compact.sort
56 transitions.map(&:new_status).compact.sort
67 else
57 else
68 []
58 []
69 end
59 end
70 end
60 end
71
61
72 # Same thing as above but uses a database query
62 # Same thing as above but uses a database query
73 # More efficient than the previous method if called just once
63 # More efficient than the previous method if called just once
74 def find_new_statuses_allowed_to(roles, tracker, author=false, assignee=false)
64 def find_new_statuses_allowed_to(roles, tracker, author=false, assignee=false)
75 if roles.present? && tracker
65 if roles.present? && tracker
76 scope = IssueStatus.
66 scope = IssueStatus.
77 joins(:workflow_transitions_as_new_status).
67 joins(:workflow_transitions_as_new_status).
78 where(:workflows => {:old_status_id => id, :role_id => roles.map(&:id), :tracker_id => tracker.id})
68 where(:workflows => {:old_status_id => id, :role_id => roles.map(&:id), :tracker_id => tracker.id})
79
69
80 unless author && assignee
70 unless author && assignee
81 if author || assignee
71 if author || assignee
82 scope = scope.where("author = ? OR assignee = ?", author, assignee)
72 scope = scope.where("author = ? OR assignee = ?", author, assignee)
83 else
73 else
84 scope = scope.where("author = ? AND assignee = ?", false, false)
74 scope = scope.where("author = ? AND assignee = ?", false, false)
85 end
75 end
86 end
76 end
87
77
88 scope.uniq.to_a.sort
78 scope.uniq.to_a.sort
89 else
79 else
90 []
80 []
91 end
81 end
92 end
82 end
93
83
94 def <=>(status)
84 def <=>(status)
95 position <=> status.position
85 position <=> status.position
96 end
86 end
97
87
98 def to_s; name end
88 def to_s; name end
99
89
100 private
90 private
101
91
102 def check_integrity
92 def check_integrity
103 raise "Can't delete status" if Issue.where(:status_id => id).any?
93 if Issue.where(:status_id => id).any?
94 raise "This status is used by some issues"
95 elsif Tracker.where(:default_status_id => id).any?
96 raise "This status is used as the default status by some trackers"
97 end
104 end
98 end
105
99
106 # Deletes associated workflows
100 # Deletes associated workflows
107 def delete_workflow_rules
101 def delete_workflow_rules
108 WorkflowRule.delete_all(["old_status_id = :id OR new_status_id = :id", {:id => id}])
102 WorkflowRule.delete_all(["old_status_id = :id OR new_status_id = :id", {:id => id}])
109 end
103 end
110 end
104 end
@@ -1,111 +1,114
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Tracker < ActiveRecord::Base
18 class Tracker < ActiveRecord::Base
19
19
20 CORE_FIELDS_UNDISABLABLE = %w(project_id tracker_id subject description priority_id is_private).freeze
20 CORE_FIELDS_UNDISABLABLE = %w(project_id tracker_id subject description priority_id is_private).freeze
21 # Fields that can be disabled
21 # Fields that can be disabled
22 # Other (future) fields should be appended, not inserted!
22 # Other (future) fields should be appended, not inserted!
23 CORE_FIELDS = %w(assigned_to_id category_id fixed_version_id parent_issue_id start_date due_date estimated_hours done_ratio).freeze
23 CORE_FIELDS = %w(assigned_to_id category_id fixed_version_id parent_issue_id start_date due_date estimated_hours done_ratio).freeze
24 CORE_FIELDS_ALL = (CORE_FIELDS_UNDISABLABLE + CORE_FIELDS).freeze
24 CORE_FIELDS_ALL = (CORE_FIELDS_UNDISABLABLE + CORE_FIELDS).freeze
25
25
26 before_destroy :check_integrity
26 before_destroy :check_integrity
27 belongs_to :default_status, :class_name => 'IssueStatus'
27 has_many :issues
28 has_many :issues
28 has_many :workflow_rules, :dependent => :delete_all do
29 has_many :workflow_rules, :dependent => :delete_all do
29 def copy(source_tracker)
30 def copy(source_tracker)
30 WorkflowRule.copy(source_tracker, nil, proxy_association.owner, nil)
31 WorkflowRule.copy(source_tracker, nil, proxy_association.owner, nil)
31 end
32 end
32 end
33 end
33
34
34 has_and_belongs_to_many :projects
35 has_and_belongs_to_many :projects
35 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
36 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
36 acts_as_list
37 acts_as_list
37
38
38 attr_protected :fields_bits
39 attr_protected :fields_bits
39
40
41 validates_presence_of :default_status
40 validates_presence_of :name
42 validates_presence_of :name
41 validates_uniqueness_of :name
43 validates_uniqueness_of :name
42 validates_length_of :name, :maximum => 30
44 validates_length_of :name, :maximum => 30
43
45
44 scope :sorted, lambda { order(:position) }
46 scope :sorted, lambda { order(:position) }
45 scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
47 scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
46
48
47 def to_s; name end
49 def to_s; name end
48
50
49 def <=>(tracker)
51 def <=>(tracker)
50 position <=> tracker.position
52 position <=> tracker.position
51 end
53 end
52
54
53 # Returns an array of IssueStatus that are used
55 # Returns an array of IssueStatus that are used
54 # in the tracker's workflows
56 # in the tracker's workflows
55 def issue_statuses
57 def issue_statuses
56 if @issue_statuses
58 @issue_statuses ||= IssueStatus.where(:id => issue_status_ids).to_a.sort
57 return @issue_statuses
59 end
58 elsif new_record?
59 return []
60 end
61
60
62 status_ids = WorkflowTransition.where(:tracker_id => id).uniq.pluck(:old_status_id, :new_status_id).flatten.uniq
61 def issue_status_ids
63 @issue_statuses = IssueStatus.where(:id => status_ids).to_a.sort
62 if new_record?
63 []
64 else
65 @issue_status_ids ||= WorkflowTransition.where(:tracker_id => id).uniq.pluck(:old_status_id, :new_status_id).flatten.uniq
66 end
64 end
67 end
65
68
66 def disabled_core_fields
69 def disabled_core_fields
67 i = -1
70 i = -1
68 @disabled_core_fields ||= CORE_FIELDS.select { i += 1; (fields_bits || 0) & (2 ** i) != 0}
71 @disabled_core_fields ||= CORE_FIELDS.select { i += 1; (fields_bits || 0) & (2 ** i) != 0}
69 end
72 end
70
73
71 def core_fields
74 def core_fields
72 CORE_FIELDS - disabled_core_fields
75 CORE_FIELDS - disabled_core_fields
73 end
76 end
74
77
75 def core_fields=(fields)
78 def core_fields=(fields)
76 raise ArgumentError.new("Tracker.core_fields takes an array") unless fields.is_a?(Array)
79 raise ArgumentError.new("Tracker.core_fields takes an array") unless fields.is_a?(Array)
77
80
78 bits = 0
81 bits = 0
79 CORE_FIELDS.each_with_index do |field, i|
82 CORE_FIELDS.each_with_index do |field, i|
80 unless fields.include?(field)
83 unless fields.include?(field)
81 bits |= 2 ** i
84 bits |= 2 ** i
82 end
85 end
83 end
86 end
84 self.fields_bits = bits
87 self.fields_bits = bits
85 @disabled_core_fields = nil
88 @disabled_core_fields = nil
86 core_fields
89 core_fields
87 end
90 end
88
91
89 # Returns the fields that are disabled for all the given trackers
92 # Returns the fields that are disabled for all the given trackers
90 def self.disabled_core_fields(trackers)
93 def self.disabled_core_fields(trackers)
91 if trackers.present?
94 if trackers.present?
92 trackers.map(&:disabled_core_fields).reduce(:&)
95 trackers.map(&:disabled_core_fields).reduce(:&)
93 else
96 else
94 []
97 []
95 end
98 end
96 end
99 end
97
100
98 # Returns the fields that are enabled for one tracker at least
101 # Returns the fields that are enabled for one tracker at least
99 def self.core_fields(trackers)
102 def self.core_fields(trackers)
100 if trackers.present?
103 if trackers.present?
101 trackers.uniq.map(&:core_fields).reduce(:|)
104 trackers.uniq.map(&:core_fields).reduce(:|)
102 else
105 else
103 CORE_FIELDS.dup
106 CORE_FIELDS.dup
104 end
107 end
105 end
108 end
106
109
107 private
110 private
108 def check_integrity
111 def check_integrity
109 raise Exception.new("Can't delete tracker") if Issue.where(:tracker_id => self.id).any?
112 raise Exception.new("Can't delete tracker") if Issue.where(:tracker_id => self.id).any?
110 end
113 end
111 end
114 end
@@ -1,12 +1,11
1 <%= error_messages_for 'issue_status' %>
1 <%= error_messages_for 'issue_status' %>
2
2
3 <div class="box tabular">
3 <div class="box tabular">
4 <p><%= f.text_field :name, :required => true %></p>
4 <p><%= f.text_field :name, :required => true %></p>
5 <% if Issue.use_status_for_done_ratio? %>
5 <% if Issue.use_status_for_done_ratio? %>
6 <p><%= f.select :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true, :label => :field_done_ratio %></p>
6 <p><%= f.select :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true, :label => :field_done_ratio %></p>
7 <% end %>
7 <% end %>
8 <p><%= f.check_box :is_closed %></p>
8 <p><%= f.check_box :is_closed %></p>
9 <p><%= f.check_box :is_default %></p>
10
9
11 <%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
10 <%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
12 </div>
11 </div>
@@ -1,10 +1,9
1 api.array :issue_statuses do
1 api.array :issue_statuses do
2 @issue_statuses.each do |status|
2 @issue_statuses.each do |status|
3 api.issue_status do
3 api.issue_status do
4 api.id status.id
4 api.id status.id
5 api.name status.name
5 api.name status.name
6 api.is_default status.is_default
7 api.is_closed status.is_closed
6 api.is_closed status.is_closed
8 end
7 end
9 end
8 end
10 end
9 end
@@ -1,39 +1,37
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to l(:label_issue_status_new), new_issue_status_path, :class => 'icon icon-add' %>
2 <%= link_to l(:label_issue_status_new), new_issue_status_path, :class => 'icon icon-add' %>
3 <%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %>
3 <%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %>
4 </div>
4 </div>
5
5
6 <h2><%=l(:label_issue_status_plural)%></h2>
6 <h2><%=l(:label_issue_status_plural)%></h2>
7
7
8 <table class="list">
8 <table class="list">
9 <thead><tr>
9 <thead><tr>
10 <th><%=l(:field_status)%></th>
10 <th><%=l(:field_status)%></th>
11 <% if Issue.use_status_for_done_ratio? %>
11 <% if Issue.use_status_for_done_ratio? %>
12 <th><%=l(:field_done_ratio)%></th>
12 <th><%=l(:field_done_ratio)%></th>
13 <% end %>
13 <% end %>
14 <th><%=l(:field_is_default)%></th>
15 <th><%=l(:field_is_closed)%></th>
14 <th><%=l(:field_is_closed)%></th>
16 <th><%=l(:button_sort)%></th>
15 <th><%=l(:button_sort)%></th>
17 <th></th>
16 <th></th>
18 </tr></thead>
17 </tr></thead>
19 <tbody>
18 <tbody>
20 <% for status in @issue_statuses %>
19 <% for status in @issue_statuses %>
21 <tr class="<%= cycle("odd", "even") %>">
20 <tr class="<%= cycle("odd", "even") %>">
22 <td class="name"><%= link_to h(status.name), edit_issue_status_path(status) %></td>
21 <td class="name"><%= link_to h(status.name), edit_issue_status_path(status) %></td>
23 <% if Issue.use_status_for_done_ratio? %>
22 <% if Issue.use_status_for_done_ratio? %>
24 <td><%= h status.default_done_ratio %></td>
23 <td><%= h status.default_done_ratio %></td>
25 <% end %>
24 <% end %>
26 <td><%= checked_image status.is_default? %></td>
27 <td><%= checked_image status.is_closed? %></td>
25 <td><%= checked_image status.is_closed? %></td>
28 <td class="reorder"><%= reorder_links('issue_status', {:action => 'update', :id => status}, :put) %></td>
26 <td class="reorder"><%= reorder_links('issue_status', {:action => 'update', :id => status}, :put) %></td>
29 <td class="buttons">
27 <td class="buttons">
30 <%= delete_link issue_status_path(status) %>
28 <%= delete_link issue_status_path(status) %>
31 </td>
29 </td>
32 </tr>
30 </tr>
33 <% end %>
31 <% end %>
34 </tbody>
32 </tbody>
35 </table>
33 </table>
36
34
37 <p class="pagination"><%= pagination_links_full @issue_status_pages %></p>
35 <p class="pagination"><%= pagination_links_full @issue_status_pages %></p>
38
36
39 <% html_title(l(:label_issue_status_plural)) -%>
37 <% html_title(l(:label_issue_status_plural)) -%>
@@ -1,81 +1,81
1 <%= labelled_fields_for :issue, @issue do |f| %>
1 <%= labelled_fields_for :issue, @issue do |f| %>
2
2
3 <div class="splitcontent">
3 <div class="splitcontent">
4 <div class="splitcontentleft">
4 <div class="splitcontentleft">
5 <% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
5 <% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
6 <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
6 <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
7 :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
7 :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
8
8 <%= hidden_field_tag 'was_default_status', @issue.status_id, :id => nil if @issue.status == @issue.default_status %>
9 <% else %>
9 <% else %>
10 <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></p>
10 <p><label><%= l(:field_status) %></label> <%= @issue.status %></p>
11 <% end %>
11 <% end %>
12
12
13 <% if @issue.safe_attribute? 'priority_id' %>
13 <% if @issue.safe_attribute? 'priority_id' %>
14 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
14 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
15 <% end %>
15 <% end %>
16
16
17 <% if @issue.safe_attribute? 'assigned_to_id' %>
17 <% if @issue.safe_attribute? 'assigned_to_id' %>
18 <p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %></p>
18 <p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %></p>
19 <% end %>
19 <% end %>
20
20
21 <% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
21 <% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
22 <p><%= f.select :category_id, (@issue.project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true, :required => @issue.required_attribute?('category_id') %>
22 <p><%= f.select :category_id, (@issue.project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true, :required => @issue.required_attribute?('category_id') %>
23 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
23 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
24 new_project_issue_category_path(@issue.project),
24 new_project_issue_category_path(@issue.project),
25 :remote => true,
25 :remote => true,
26 :method => 'get',
26 :method => 'get',
27 :title => l(:label_issue_category_new),
27 :title => l(:label_issue_category_new),
28 :tabindex => 200) if User.current.allowed_to?(:manage_categories, @issue.project) %></p>
28 :tabindex => 200) if User.current.allowed_to?(:manage_categories, @issue.project) %></p>
29 <% end %>
29 <% end %>
30
30
31 <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
31 <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
32 <p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), :include_blank => true, :required => @issue.required_attribute?('fixed_version_id') %>
32 <p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), :include_blank => true, :required => @issue.required_attribute?('fixed_version_id') %>
33 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
33 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
34 new_project_version_path(@issue.project),
34 new_project_version_path(@issue.project),
35 :remote => true,
35 :remote => true,
36 :method => 'get',
36 :method => 'get',
37 :title => l(:label_version_new),
37 :title => l(:label_version_new),
38 :tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
38 :tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
39 </p>
39 </p>
40 <% end %>
40 <% end %>
41 </div>
41 </div>
42
42
43 <div class="splitcontentright">
43 <div class="splitcontentright">
44 <% if @issue.safe_attribute? 'parent_issue_id' %>
44 <% if @issue.safe_attribute? 'parent_issue_id' %>
45 <p id="parent_issue"><%= f.text_field :parent_issue_id, :size => 10, :required => @issue.required_attribute?('parent_issue_id') %></p>
45 <p id="parent_issue"><%= f.text_field :parent_issue_id, :size => 10, :required => @issue.required_attribute?('parent_issue_id') %></p>
46 <%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => Setting.cross_project_subtasks)}')" %>
46 <%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => Setting.cross_project_subtasks)}')" %>
47 <% end %>
47 <% end %>
48
48
49 <% if @issue.safe_attribute? 'start_date' %>
49 <% if @issue.safe_attribute? 'start_date' %>
50 <p id="start_date_area">
50 <p id="start_date_area">
51 <%= f.text_field(:start_date, :size => 10, :disabled => !@issue.leaf?,
51 <%= f.text_field(:start_date, :size => 10, :disabled => !@issue.leaf?,
52 :required => @issue.required_attribute?('start_date')) %>
52 :required => @issue.required_attribute?('start_date')) %>
53 <%= calendar_for('issue_start_date') if @issue.leaf? %>
53 <%= calendar_for('issue_start_date') if @issue.leaf? %>
54 </p>
54 </p>
55 <% end %>
55 <% end %>
56
56
57 <% if @issue.safe_attribute? 'due_date' %>
57 <% if @issue.safe_attribute? 'due_date' %>
58 <p id="due_date_area">
58 <p id="due_date_area">
59 <%= f.text_field(:due_date, :size => 10, :disabled => !@issue.leaf?,
59 <%= f.text_field(:due_date, :size => 10, :disabled => !@issue.leaf?,
60 :required => @issue.required_attribute?('due_date')) %>
60 :required => @issue.required_attribute?('due_date')) %>
61 <%= calendar_for('issue_due_date') if @issue.leaf? %>
61 <%= calendar_for('issue_due_date') if @issue.leaf? %>
62 </p>
62 </p>
63 <% end %>
63 <% end %>
64
64
65 <% if @issue.safe_attribute? 'estimated_hours' %>
65 <% if @issue.safe_attribute? 'estimated_hours' %>
66 <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
66 <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
67 <% end %>
67 <% end %>
68
68
69 <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
69 <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
70 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
70 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
71 <% end %>
71 <% end %>
72 </div>
72 </div>
73 </div>
73 </div>
74
74
75 <% if @issue.safe_attribute? 'custom_field_values' %>
75 <% if @issue.safe_attribute? 'custom_field_values' %>
76 <%= render :partial => 'issues/form_custom_fields' %>
76 <%= render :partial => 'issues/form_custom_fields' %>
77 <% end %>
77 <% end %>
78
78
79 <% end %>
79 <% end %>
80
80
81 <% include_calendar_headers_tags %>
81 <% include_calendar_headers_tags %>
@@ -1,52 +1,56
1 <%= error_messages_for 'tracker' %>
1 <%= error_messages_for 'tracker' %>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <div class="box tabular">
4 <div class="box tabular">
5 <!--[form:tracker]-->
5 <!--[form:tracker]-->
6 <p><%= f.text_field :name, :required => true %></p>
6 <p><%= f.text_field :name, :required => true %></p>
7 <p><%= f.select :default_status_id,
8 IssueStatus.sorted.map {|s| [s.name, s.id]},
9 :include_blank => @tracker.default_status.nil?,
10 :required => true %>
11 </p>
7 <p><%= f.check_box :is_in_roadmap %></p>
12 <p><%= f.check_box :is_in_roadmap %></p>
8
9 <p>
13 <p>
10 <label><%= l(:field_core_fields) %></label>
14 <label><%= l(:field_core_fields) %></label>
11 <% Tracker::CORE_FIELDS.each do |field| %>
15 <% Tracker::CORE_FIELDS.each do |field| %>
12 <label class="block">
16 <label class="block">
13 <%= check_box_tag 'tracker[core_fields][]', field, @tracker.core_fields.include?(field), :id => nil %>
17 <%= check_box_tag 'tracker[core_fields][]', field, @tracker.core_fields.include?(field), :id => nil %>
14 <%= l("field_#{field}".sub(/_id$/, '')) %>
18 <%= l("field_#{field}".sub(/_id$/, '')) %>
15 </label>
19 </label>
16 <% end %>
20 <% end %>
17 </p>
21 </p>
18 <%= hidden_field_tag 'tracker[core_fields][]', '' %>
22 <%= hidden_field_tag 'tracker[core_fields][]', '' %>
19
23
20 <% if IssueCustomField.all.any? %>
24 <% if IssueCustomField.all.any? %>
21 <p>
25 <p>
22 <label><%= l(:label_custom_field_plural) %></label>
26 <label><%= l(:label_custom_field_plural) %></label>
23 <% IssueCustomField.all.each do |field| %>
27 <% IssueCustomField.all.each do |field| %>
24 <label class="block">
28 <label class="block">
25 <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field), :id => nil %>
29 <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field), :id => nil %>
26 <%=h field.name %>
30 <%=h field.name %>
27 </label>
31 </label>
28 <% end %>
32 <% end %>
29 </p>
33 </p>
30 <%= hidden_field_tag 'tracker[custom_field_ids][]', '' %>
34 <%= hidden_field_tag 'tracker[custom_field_ids][]', '' %>
31 <% end %>
35 <% end %>
32
36
33 <% if @tracker.new_record? && @trackers.any? %>
37 <% if @tracker.new_record? && @trackers.any? %>
34 <p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label>
38 <p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label>
35 <%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@trackers, :id, :name)) %></p>
39 <%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@trackers, :id, :name)) %></p>
36 <% end %>
40 <% end %>
37 <!--[eoform:tracker]-->
41 <!--[eoform:tracker]-->
38 </div>
42 </div>
39 <%= submit_tag l(@tracker.new_record? ? :button_create : :button_save) %>
43 <%= submit_tag l(@tracker.new_record? ? :button_create : :button_save) %>
40 </div>
44 </div>
41
45
42 <div class="splitcontentright">
46 <div class="splitcontentright">
43 <% if @projects.any? %>
47 <% if @projects.any? %>
44 <fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
48 <fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
45 <%= render_project_nested_lists(@projects) do |p|
49 <%= render_project_nested_lists(@projects) do |p|
46 content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
50 content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
47 end %>
51 end %>
48 <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
52 <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
49 <p><%= check_all_links 'tracker_project_ids' %></p>
53 <p><%= check_all_links 'tracker_project_ids' %></p>
50 </fieldset>
54 </fieldset>
51 <% end %>
55 <% end %>
52 </div>
56 </div>
@@ -1,8 +1,9
1 api.array :trackers do
1 api.array :trackers do
2 @trackers.each do |tracker|
2 @trackers.each do |tracker|
3 api.tracker do
3 api.tracker do
4 api.id tracker.id
4 api.id tracker.id
5 api.name tracker.name
5 api.name tracker.name
6 api.default_status(:id => tracker.default_status.id, :name => tracker.default_status.name) unless tracker.default_status.nil?
6 end
7 end
7 end
8 end
8 end
9 end
@@ -1,1112 +1,1113
1 en:
1 en:
2 # Text direction: Left-to-Right (ltr) or Right-to-Left (rtl)
2 # Text direction: Left-to-Right (ltr) or Right-to-Left (rtl)
3 direction: ltr
3 direction: ltr
4 date:
4 date:
5 formats:
5 formats:
6 # Use the strftime parameters for formats.
6 # Use the strftime parameters for formats.
7 # When no format has been given, it uses default.
7 # When no format has been given, it uses default.
8 # You can provide other formats here if you like!
8 # You can provide other formats here if you like!
9 default: "%m/%d/%Y"
9 default: "%m/%d/%Y"
10 short: "%b %d"
10 short: "%b %d"
11 long: "%B %d, %Y"
11 long: "%B %d, %Y"
12
12
13 day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
13 day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
14 abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
14 abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
15
15
16 # Don't forget the nil at the beginning; there's no such thing as a 0th month
16 # Don't forget the nil at the beginning; there's no such thing as a 0th month
17 month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
17 month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
18 abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
18 abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
19 # Used in date_select and datime_select.
19 # Used in date_select and datime_select.
20 order:
20 order:
21 - :year
21 - :year
22 - :month
22 - :month
23 - :day
23 - :day
24
24
25 time:
25 time:
26 formats:
26 formats:
27 default: "%m/%d/%Y %I:%M %p"
27 default: "%m/%d/%Y %I:%M %p"
28 time: "%I:%M %p"
28 time: "%I:%M %p"
29 short: "%d %b %H:%M"
29 short: "%d %b %H:%M"
30 long: "%B %d, %Y %H:%M"
30 long: "%B %d, %Y %H:%M"
31 am: "am"
31 am: "am"
32 pm: "pm"
32 pm: "pm"
33
33
34 datetime:
34 datetime:
35 distance_in_words:
35 distance_in_words:
36 half_a_minute: "half a minute"
36 half_a_minute: "half a minute"
37 less_than_x_seconds:
37 less_than_x_seconds:
38 one: "less than 1 second"
38 one: "less than 1 second"
39 other: "less than %{count} seconds"
39 other: "less than %{count} seconds"
40 x_seconds:
40 x_seconds:
41 one: "1 second"
41 one: "1 second"
42 other: "%{count} seconds"
42 other: "%{count} seconds"
43 less_than_x_minutes:
43 less_than_x_minutes:
44 one: "less than a minute"
44 one: "less than a minute"
45 other: "less than %{count} minutes"
45 other: "less than %{count} minutes"
46 x_minutes:
46 x_minutes:
47 one: "1 minute"
47 one: "1 minute"
48 other: "%{count} minutes"
48 other: "%{count} minutes"
49 about_x_hours:
49 about_x_hours:
50 one: "about 1 hour"
50 one: "about 1 hour"
51 other: "about %{count} hours"
51 other: "about %{count} hours"
52 x_hours:
52 x_hours:
53 one: "1 hour"
53 one: "1 hour"
54 other: "%{count} hours"
54 other: "%{count} hours"
55 x_days:
55 x_days:
56 one: "1 day"
56 one: "1 day"
57 other: "%{count} days"
57 other: "%{count} days"
58 about_x_months:
58 about_x_months:
59 one: "about 1 month"
59 one: "about 1 month"
60 other: "about %{count} months"
60 other: "about %{count} months"
61 x_months:
61 x_months:
62 one: "1 month"
62 one: "1 month"
63 other: "%{count} months"
63 other: "%{count} months"
64 about_x_years:
64 about_x_years:
65 one: "about 1 year"
65 one: "about 1 year"
66 other: "about %{count} years"
66 other: "about %{count} years"
67 over_x_years:
67 over_x_years:
68 one: "over 1 year"
68 one: "over 1 year"
69 other: "over %{count} years"
69 other: "over %{count} years"
70 almost_x_years:
70 almost_x_years:
71 one: "almost 1 year"
71 one: "almost 1 year"
72 other: "almost %{count} years"
72 other: "almost %{count} years"
73
73
74 number:
74 number:
75 format:
75 format:
76 separator: "."
76 separator: "."
77 delimiter: ""
77 delimiter: ""
78 precision: 3
78 precision: 3
79
79
80 human:
80 human:
81 format:
81 format:
82 delimiter: ""
82 delimiter: ""
83 precision: 3
83 precision: 3
84 storage_units:
84 storage_units:
85 format: "%n %u"
85 format: "%n %u"
86 units:
86 units:
87 byte:
87 byte:
88 one: "Byte"
88 one: "Byte"
89 other: "Bytes"
89 other: "Bytes"
90 kb: "KB"
90 kb: "KB"
91 mb: "MB"
91 mb: "MB"
92 gb: "GB"
92 gb: "GB"
93 tb: "TB"
93 tb: "TB"
94
94
95 # Used in array.to_sentence.
95 # Used in array.to_sentence.
96 support:
96 support:
97 array:
97 array:
98 sentence_connector: "and"
98 sentence_connector: "and"
99 skip_last_comma: false
99 skip_last_comma: false
100
100
101 activerecord:
101 activerecord:
102 errors:
102 errors:
103 template:
103 template:
104 header:
104 header:
105 one: "1 error prohibited this %{model} from being saved"
105 one: "1 error prohibited this %{model} from being saved"
106 other: "%{count} errors prohibited this %{model} from being saved"
106 other: "%{count} errors prohibited this %{model} from being saved"
107 messages:
107 messages:
108 inclusion: "is not included in the list"
108 inclusion: "is not included in the list"
109 exclusion: "is reserved"
109 exclusion: "is reserved"
110 invalid: "is invalid"
110 invalid: "is invalid"
111 confirmation: "doesn't match confirmation"
111 confirmation: "doesn't match confirmation"
112 accepted: "must be accepted"
112 accepted: "must be accepted"
113 empty: "can't be empty"
113 empty: "can't be empty"
114 blank: "can't be blank"
114 blank: "can't be blank"
115 too_long: "is too long (maximum is %{count} characters)"
115 too_long: "is too long (maximum is %{count} characters)"
116 too_short: "is too short (minimum is %{count} characters)"
116 too_short: "is too short (minimum is %{count} characters)"
117 wrong_length: "is the wrong length (should be %{count} characters)"
117 wrong_length: "is the wrong length (should be %{count} characters)"
118 taken: "has already been taken"
118 taken: "has already been taken"
119 not_a_number: "is not a number"
119 not_a_number: "is not a number"
120 not_a_date: "is not a valid date"
120 not_a_date: "is not a valid date"
121 greater_than: "must be greater than %{count}"
121 greater_than: "must be greater than %{count}"
122 greater_than_or_equal_to: "must be greater than or equal to %{count}"
122 greater_than_or_equal_to: "must be greater than or equal to %{count}"
123 equal_to: "must be equal to %{count}"
123 equal_to: "must be equal to %{count}"
124 less_than: "must be less than %{count}"
124 less_than: "must be less than %{count}"
125 less_than_or_equal_to: "must be less than or equal to %{count}"
125 less_than_or_equal_to: "must be less than or equal to %{count}"
126 odd: "must be odd"
126 odd: "must be odd"
127 even: "must be even"
127 even: "must be even"
128 greater_than_start_date: "must be greater than start date"
128 greater_than_start_date: "must be greater than start date"
129 not_same_project: "doesn't belong to the same project"
129 not_same_project: "doesn't belong to the same project"
130 circular_dependency: "This relation would create a circular dependency"
130 circular_dependency: "This relation would create a circular dependency"
131 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
131 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133
133
134 actionview_instancetag_blank_option: Please select
134 actionview_instancetag_blank_option: Please select
135
135
136 general_text_No: 'No'
136 general_text_No: 'No'
137 general_text_Yes: 'Yes'
137 general_text_Yes: 'Yes'
138 general_text_no: 'no'
138 general_text_no: 'no'
139 general_text_yes: 'yes'
139 general_text_yes: 'yes'
140 general_lang_name: 'English'
140 general_lang_name: 'English'
141 general_csv_separator: ','
141 general_csv_separator: ','
142 general_csv_decimal_separator: '.'
142 general_csv_decimal_separator: '.'
143 general_csv_encoding: ISO-8859-1
143 general_csv_encoding: ISO-8859-1
144 general_pdf_fontname: freesans
144 general_pdf_fontname: freesans
145 general_first_day_of_week: '7'
145 general_first_day_of_week: '7'
146
146
147 notice_account_updated: Account was successfully updated.
147 notice_account_updated: Account was successfully updated.
148 notice_account_invalid_creditentials: Invalid user or password
148 notice_account_invalid_creditentials: Invalid user or password
149 notice_account_password_updated: Password was successfully updated.
149 notice_account_password_updated: Password was successfully updated.
150 notice_account_wrong_password: Wrong password
150 notice_account_wrong_password: Wrong password
151 notice_account_register_done: Account was successfully created. An email containing the instructions to activate your account was sent to %{email}.
151 notice_account_register_done: Account was successfully created. An email containing the instructions to activate your account was sent to %{email}.
152 notice_account_unknown_email: Unknown user.
152 notice_account_unknown_email: Unknown user.
153 notice_account_not_activated_yet: You haven't activated your account yet. If you want to receive a new activation email, please <a href="%{url}">click this link</a>.
153 notice_account_not_activated_yet: You haven't activated your account yet. If you want to receive a new activation email, please <a href="%{url}">click this link</a>.
154 notice_account_locked: Your account is locked.
154 notice_account_locked: Your account is locked.
155 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
155 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
156 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
156 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
157 notice_account_activated: Your account has been activated. You can now log in.
157 notice_account_activated: Your account has been activated. You can now log in.
158 notice_successful_create: Successful creation.
158 notice_successful_create: Successful creation.
159 notice_successful_update: Successful update.
159 notice_successful_update: Successful update.
160 notice_successful_delete: Successful deletion.
160 notice_successful_delete: Successful deletion.
161 notice_successful_connection: Successful connection.
161 notice_successful_connection: Successful connection.
162 notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
162 notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
163 notice_locking_conflict: Data has been updated by another user.
163 notice_locking_conflict: Data has been updated by another user.
164 notice_not_authorized: You are not authorized to access this page.
164 notice_not_authorized: You are not authorized to access this page.
165 notice_not_authorized_archived_project: The project you're trying to access has been archived.
165 notice_not_authorized_archived_project: The project you're trying to access has been archived.
166 notice_email_sent: "An email was sent to %{value}"
166 notice_email_sent: "An email was sent to %{value}"
167 notice_email_error: "An error occurred while sending mail (%{value})"
167 notice_email_error: "An error occurred while sending mail (%{value})"
168 notice_feeds_access_key_reseted: Your Atom access key was reset.
168 notice_feeds_access_key_reseted: Your Atom access key was reset.
169 notice_api_access_key_reseted: Your API access key was reset.
169 notice_api_access_key_reseted: Your API access key was reset.
170 notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}."
170 notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}."
171 notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}."
171 notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}."
172 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
172 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
173 notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit."
173 notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit."
174 notice_account_pending: "Your account was created and is now pending administrator approval."
174 notice_account_pending: "Your account was created and is now pending administrator approval."
175 notice_default_data_loaded: Default configuration successfully loaded.
175 notice_default_data_loaded: Default configuration successfully loaded.
176 notice_unable_delete_version: Unable to delete version.
176 notice_unable_delete_version: Unable to delete version.
177 notice_unable_delete_time_entry: Unable to delete time log entry.
177 notice_unable_delete_time_entry: Unable to delete time log entry.
178 notice_issue_done_ratios_updated: Issue done ratios updated.
178 notice_issue_done_ratios_updated: Issue done ratios updated.
179 notice_gantt_chart_truncated: "The chart was truncated because it exceeds the maximum number of items that can be displayed (%{max})"
179 notice_gantt_chart_truncated: "The chart was truncated because it exceeds the maximum number of items that can be displayed (%{max})"
180 notice_issue_successful_create: "Issue %{id} created."
180 notice_issue_successful_create: "Issue %{id} created."
181 notice_issue_update_conflict: "The issue has been updated by an other user while you were editing it."
181 notice_issue_update_conflict: "The issue has been updated by an other user while you were editing it."
182 notice_account_deleted: "Your account has been permanently deleted."
182 notice_account_deleted: "Your account has been permanently deleted."
183 notice_user_successful_create: "User %{id} created."
183 notice_user_successful_create: "User %{id} created."
184 notice_new_password_must_be_different: The new password must be different from the current password
184 notice_new_password_must_be_different: The new password must be different from the current password
185
185
186 error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
186 error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
187 error_scm_not_found: "The entry or revision was not found in the repository."
187 error_scm_not_found: "The entry or revision was not found in the repository."
188 error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
188 error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
189 error_scm_annotate: "The entry does not exist or cannot be annotated."
189 error_scm_annotate: "The entry does not exist or cannot be annotated."
190 error_scm_annotate_big_text_file: "The entry cannot be annotated, as it exceeds the maximum text file size."
190 error_scm_annotate_big_text_file: "The entry cannot be annotated, as it exceeds the maximum text file size."
191 error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
191 error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
192 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
192 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
193 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
193 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
194 error_can_not_delete_custom_field: Unable to delete custom field
194 error_can_not_delete_custom_field: Unable to delete custom field
195 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
195 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
196 error_can_not_remove_role: "This role is in use and cannot be deleted."
196 error_can_not_remove_role: "This role is in use and cannot be deleted."
197 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version cannot be reopened'
197 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version cannot be reopened'
198 error_can_not_archive_project: This project cannot be archived
198 error_can_not_archive_project: This project cannot be archived
199 error_issue_done_ratios_not_updated: "Issue done ratios not updated."
199 error_issue_done_ratios_not_updated: "Issue done ratios not updated."
200 error_workflow_copy_source: 'Please select a source tracker or role'
200 error_workflow_copy_source: 'Please select a source tracker or role'
201 error_workflow_copy_target: 'Please select target tracker(s) and role(s)'
201 error_workflow_copy_target: 'Please select target tracker(s) and role(s)'
202 error_unable_delete_issue_status: 'Unable to delete issue status'
202 error_unable_delete_issue_status: 'Unable to delete issue status'
203 error_unable_to_connect: "Unable to connect (%{value})"
203 error_unable_to_connect: "Unable to connect (%{value})"
204 error_attachment_too_big: "This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size})"
204 error_attachment_too_big: "This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size})"
205 error_session_expired: "Your session has expired. Please login again."
205 error_session_expired: "Your session has expired. Please login again."
206 warning_attachments_not_saved: "%{count} file(s) could not be saved."
206 warning_attachments_not_saved: "%{count} file(s) could not be saved."
207
207
208 mail_subject_lost_password: "Your %{value} password"
208 mail_subject_lost_password: "Your %{value} password"
209 mail_body_lost_password: 'To change your password, click on the following link:'
209 mail_body_lost_password: 'To change your password, click on the following link:'
210 mail_subject_register: "Your %{value} account activation"
210 mail_subject_register: "Your %{value} account activation"
211 mail_body_register: 'To activate your account, click on the following link:'
211 mail_body_register: 'To activate your account, click on the following link:'
212 mail_body_account_information_external: "You can use your %{value} account to log in."
212 mail_body_account_information_external: "You can use your %{value} account to log in."
213 mail_body_account_information: Your account information
213 mail_body_account_information: Your account information
214 mail_subject_account_activation_request: "%{value} account activation request"
214 mail_subject_account_activation_request: "%{value} account activation request"
215 mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
215 mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
216 mail_subject_reminder: "%{count} issue(s) due in the next %{days} days"
216 mail_subject_reminder: "%{count} issue(s) due in the next %{days} days"
217 mail_body_reminder: "%{count} issue(s) that are assigned to you are due in the next %{days} days:"
217 mail_body_reminder: "%{count} issue(s) that are assigned to you are due in the next %{days} days:"
218 mail_subject_wiki_content_added: "'%{id}' wiki page has been added"
218 mail_subject_wiki_content_added: "'%{id}' wiki page has been added"
219 mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
219 mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
220 mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
220 mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
221 mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
221 mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
222
222
223 field_name: Name
223 field_name: Name
224 field_description: Description
224 field_description: Description
225 field_summary: Summary
225 field_summary: Summary
226 field_is_required: Required
226 field_is_required: Required
227 field_firstname: First name
227 field_firstname: First name
228 field_lastname: Last name
228 field_lastname: Last name
229 field_mail: Email
229 field_mail: Email
230 field_filename: File
230 field_filename: File
231 field_filesize: Size
231 field_filesize: Size
232 field_downloads: Downloads
232 field_downloads: Downloads
233 field_author: Author
233 field_author: Author
234 field_created_on: Created
234 field_created_on: Created
235 field_updated_on: Updated
235 field_updated_on: Updated
236 field_closed_on: Closed
236 field_closed_on: Closed
237 field_field_format: Format
237 field_field_format: Format
238 field_is_for_all: For all projects
238 field_is_for_all: For all projects
239 field_possible_values: Possible values
239 field_possible_values: Possible values
240 field_regexp: Regular expression
240 field_regexp: Regular expression
241 field_min_length: Minimum length
241 field_min_length: Minimum length
242 field_max_length: Maximum length
242 field_max_length: Maximum length
243 field_value: Value
243 field_value: Value
244 field_category: Category
244 field_category: Category
245 field_title: Title
245 field_title: Title
246 field_project: Project
246 field_project: Project
247 field_issue: Issue
247 field_issue: Issue
248 field_status: Status
248 field_status: Status
249 field_notes: Notes
249 field_notes: Notes
250 field_is_closed: Issue closed
250 field_is_closed: Issue closed
251 field_is_default: Default value
251 field_is_default: Default value
252 field_tracker: Tracker
252 field_tracker: Tracker
253 field_subject: Subject
253 field_subject: Subject
254 field_due_date: Due date
254 field_due_date: Due date
255 field_assigned_to: Assignee
255 field_assigned_to: Assignee
256 field_priority: Priority
256 field_priority: Priority
257 field_fixed_version: Target version
257 field_fixed_version: Target version
258 field_user: User
258 field_user: User
259 field_principal: Principal
259 field_principal: Principal
260 field_role: Role
260 field_role: Role
261 field_homepage: Homepage
261 field_homepage: Homepage
262 field_is_public: Public
262 field_is_public: Public
263 field_parent: Subproject of
263 field_parent: Subproject of
264 field_is_in_roadmap: Issues displayed in roadmap
264 field_is_in_roadmap: Issues displayed in roadmap
265 field_login: Login
265 field_login: Login
266 field_mail_notification: Email notifications
266 field_mail_notification: Email notifications
267 field_admin: Administrator
267 field_admin: Administrator
268 field_last_login_on: Last connection
268 field_last_login_on: Last connection
269 field_language: Language
269 field_language: Language
270 field_effective_date: Date
270 field_effective_date: Date
271 field_password: Password
271 field_password: Password
272 field_new_password: New password
272 field_new_password: New password
273 field_password_confirmation: Confirmation
273 field_password_confirmation: Confirmation
274 field_version: Version
274 field_version: Version
275 field_type: Type
275 field_type: Type
276 field_host: Host
276 field_host: Host
277 field_port: Port
277 field_port: Port
278 field_account: Account
278 field_account: Account
279 field_base_dn: Base DN
279 field_base_dn: Base DN
280 field_attr_login: Login attribute
280 field_attr_login: Login attribute
281 field_attr_firstname: Firstname attribute
281 field_attr_firstname: Firstname attribute
282 field_attr_lastname: Lastname attribute
282 field_attr_lastname: Lastname attribute
283 field_attr_mail: Email attribute
283 field_attr_mail: Email attribute
284 field_onthefly: On-the-fly user creation
284 field_onthefly: On-the-fly user creation
285 field_start_date: Start date
285 field_start_date: Start date
286 field_done_ratio: "% Done"
286 field_done_ratio: "% Done"
287 field_auth_source: Authentication mode
287 field_auth_source: Authentication mode
288 field_hide_mail: Hide my email address
288 field_hide_mail: Hide my email address
289 field_comments: Comment
289 field_comments: Comment
290 field_url: URL
290 field_url: URL
291 field_start_page: Start page
291 field_start_page: Start page
292 field_subproject: Subproject
292 field_subproject: Subproject
293 field_hours: Hours
293 field_hours: Hours
294 field_activity: Activity
294 field_activity: Activity
295 field_spent_on: Date
295 field_spent_on: Date
296 field_identifier: Identifier
296 field_identifier: Identifier
297 field_is_filter: Used as a filter
297 field_is_filter: Used as a filter
298 field_issue_to: Related issue
298 field_issue_to: Related issue
299 field_delay: Delay
299 field_delay: Delay
300 field_assignable: Issues can be assigned to this role
300 field_assignable: Issues can be assigned to this role
301 field_redirect_existing_links: Redirect existing links
301 field_redirect_existing_links: Redirect existing links
302 field_estimated_hours: Estimated time
302 field_estimated_hours: Estimated time
303 field_column_names: Columns
303 field_column_names: Columns
304 field_time_entries: Log time
304 field_time_entries: Log time
305 field_time_zone: Time zone
305 field_time_zone: Time zone
306 field_searchable: Searchable
306 field_searchable: Searchable
307 field_default_value: Default value
307 field_default_value: Default value
308 field_comments_sorting: Display comments
308 field_comments_sorting: Display comments
309 field_parent_title: Parent page
309 field_parent_title: Parent page
310 field_editable: Editable
310 field_editable: Editable
311 field_watcher: Watcher
311 field_watcher: Watcher
312 field_identity_url: OpenID URL
312 field_identity_url: OpenID URL
313 field_content: Content
313 field_content: Content
314 field_group_by: Group results by
314 field_group_by: Group results by
315 field_sharing: Sharing
315 field_sharing: Sharing
316 field_parent_issue: Parent task
316 field_parent_issue: Parent task
317 field_member_of_group: "Assignee's group"
317 field_member_of_group: "Assignee's group"
318 field_assigned_to_role: "Assignee's role"
318 field_assigned_to_role: "Assignee's role"
319 field_text: Text field
319 field_text: Text field
320 field_visible: Visible
320 field_visible: Visible
321 field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
321 field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
322 field_issues_visibility: Issues visibility
322 field_issues_visibility: Issues visibility
323 field_is_private: Private
323 field_is_private: Private
324 field_commit_logs_encoding: Commit messages encoding
324 field_commit_logs_encoding: Commit messages encoding
325 field_scm_path_encoding: Path encoding
325 field_scm_path_encoding: Path encoding
326 field_path_to_repository: Path to repository
326 field_path_to_repository: Path to repository
327 field_root_directory: Root directory
327 field_root_directory: Root directory
328 field_cvsroot: CVSROOT
328 field_cvsroot: CVSROOT
329 field_cvs_module: Module
329 field_cvs_module: Module
330 field_repository_is_default: Main repository
330 field_repository_is_default: Main repository
331 field_multiple: Multiple values
331 field_multiple: Multiple values
332 field_auth_source_ldap_filter: LDAP filter
332 field_auth_source_ldap_filter: LDAP filter
333 field_core_fields: Standard fields
333 field_core_fields: Standard fields
334 field_timeout: "Timeout (in seconds)"
334 field_timeout: "Timeout (in seconds)"
335 field_board_parent: Parent forum
335 field_board_parent: Parent forum
336 field_private_notes: Private notes
336 field_private_notes: Private notes
337 field_inherit_members: Inherit members
337 field_inherit_members: Inherit members
338 field_generate_password: Generate password
338 field_generate_password: Generate password
339 field_must_change_passwd: Must change password at next logon
339 field_must_change_passwd: Must change password at next logon
340 field_default_status: Default status
340
341
341 setting_app_title: Application title
342 setting_app_title: Application title
342 setting_app_subtitle: Application subtitle
343 setting_app_subtitle: Application subtitle
343 setting_welcome_text: Welcome text
344 setting_welcome_text: Welcome text
344 setting_default_language: Default language
345 setting_default_language: Default language
345 setting_login_required: Authentication required
346 setting_login_required: Authentication required
346 setting_self_registration: Self-registration
347 setting_self_registration: Self-registration
347 setting_attachment_max_size: Maximum attachment size
348 setting_attachment_max_size: Maximum attachment size
348 setting_issues_export_limit: Issues export limit
349 setting_issues_export_limit: Issues export limit
349 setting_mail_from: Emission email address
350 setting_mail_from: Emission email address
350 setting_bcc_recipients: Blind carbon copy recipients (bcc)
351 setting_bcc_recipients: Blind carbon copy recipients (bcc)
351 setting_plain_text_mail: Plain text mail (no HTML)
352 setting_plain_text_mail: Plain text mail (no HTML)
352 setting_host_name: Host name and path
353 setting_host_name: Host name and path
353 setting_text_formatting: Text formatting
354 setting_text_formatting: Text formatting
354 setting_wiki_compression: Wiki history compression
355 setting_wiki_compression: Wiki history compression
355 setting_feeds_limit: Maximum number of items in Atom feeds
356 setting_feeds_limit: Maximum number of items in Atom feeds
356 setting_default_projects_public: New projects are public by default
357 setting_default_projects_public: New projects are public by default
357 setting_autofetch_changesets: Fetch commits automatically
358 setting_autofetch_changesets: Fetch commits automatically
358 setting_sys_api_enabled: Enable WS for repository management
359 setting_sys_api_enabled: Enable WS for repository management
359 setting_commit_ref_keywords: Referencing keywords
360 setting_commit_ref_keywords: Referencing keywords
360 setting_commit_fix_keywords: Fixing keywords
361 setting_commit_fix_keywords: Fixing keywords
361 setting_autologin: Autologin
362 setting_autologin: Autologin
362 setting_date_format: Date format
363 setting_date_format: Date format
363 setting_time_format: Time format
364 setting_time_format: Time format
364 setting_cross_project_issue_relations: Allow cross-project issue relations
365 setting_cross_project_issue_relations: Allow cross-project issue relations
365 setting_cross_project_subtasks: Allow cross-project subtasks
366 setting_cross_project_subtasks: Allow cross-project subtasks
366 setting_issue_list_default_columns: Default columns displayed on the issue list
367 setting_issue_list_default_columns: Default columns displayed on the issue list
367 setting_repositories_encodings: Attachments and repositories encodings
368 setting_repositories_encodings: Attachments and repositories encodings
368 setting_emails_header: Email header
369 setting_emails_header: Email header
369 setting_emails_footer: Email footer
370 setting_emails_footer: Email footer
370 setting_protocol: Protocol
371 setting_protocol: Protocol
371 setting_per_page_options: Objects per page options
372 setting_per_page_options: Objects per page options
372 setting_user_format: Users display format
373 setting_user_format: Users display format
373 setting_activity_days_default: Days displayed on project activity
374 setting_activity_days_default: Days displayed on project activity
374 setting_display_subprojects_issues: Display subprojects issues on main projects by default
375 setting_display_subprojects_issues: Display subprojects issues on main projects by default
375 setting_enabled_scm: Enabled SCM
376 setting_enabled_scm: Enabled SCM
376 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
377 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
377 setting_mail_handler_api_enabled: Enable WS for incoming emails
378 setting_mail_handler_api_enabled: Enable WS for incoming emails
378 setting_mail_handler_api_key: API key
379 setting_mail_handler_api_key: API key
379 setting_sequential_project_identifiers: Generate sequential project identifiers
380 setting_sequential_project_identifiers: Generate sequential project identifiers
380 setting_gravatar_enabled: Use Gravatar user icons
381 setting_gravatar_enabled: Use Gravatar user icons
381 setting_gravatar_default: Default Gravatar image
382 setting_gravatar_default: Default Gravatar image
382 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
383 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
383 setting_file_max_size_displayed: Maximum size of text files displayed inline
384 setting_file_max_size_displayed: Maximum size of text files displayed inline
384 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
385 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
385 setting_openid: Allow OpenID login and registration
386 setting_openid: Allow OpenID login and registration
386 setting_password_min_length: Minimum password length
387 setting_password_min_length: Minimum password length
387 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
388 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
388 setting_default_projects_modules: Default enabled modules for new projects
389 setting_default_projects_modules: Default enabled modules for new projects
389 setting_issue_done_ratio: Calculate the issue done ratio with
390 setting_issue_done_ratio: Calculate the issue done ratio with
390 setting_issue_done_ratio_issue_field: Use the issue field
391 setting_issue_done_ratio_issue_field: Use the issue field
391 setting_issue_done_ratio_issue_status: Use the issue status
392 setting_issue_done_ratio_issue_status: Use the issue status
392 setting_start_of_week: Start calendars on
393 setting_start_of_week: Start calendars on
393 setting_rest_api_enabled: Enable REST web service
394 setting_rest_api_enabled: Enable REST web service
394 setting_cache_formatted_text: Cache formatted text
395 setting_cache_formatted_text: Cache formatted text
395 setting_default_notification_option: Default notification option
396 setting_default_notification_option: Default notification option
396 setting_commit_logtime_enabled: Enable time logging
397 setting_commit_logtime_enabled: Enable time logging
397 setting_commit_logtime_activity_id: Activity for logged time
398 setting_commit_logtime_activity_id: Activity for logged time
398 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
399 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
399 setting_issue_group_assignment: Allow issue assignment to groups
400 setting_issue_group_assignment: Allow issue assignment to groups
400 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
401 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
401 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
402 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
402 setting_unsubscribe: Allow users to delete their own account
403 setting_unsubscribe: Allow users to delete their own account
403 setting_session_lifetime: Session maximum lifetime
404 setting_session_lifetime: Session maximum lifetime
404 setting_session_timeout: Session inactivity timeout
405 setting_session_timeout: Session inactivity timeout
405 setting_thumbnails_enabled: Display attachment thumbnails
406 setting_thumbnails_enabled: Display attachment thumbnails
406 setting_thumbnails_size: Thumbnails size (in pixels)
407 setting_thumbnails_size: Thumbnails size (in pixels)
407 setting_non_working_week_days: Non-working days
408 setting_non_working_week_days: Non-working days
408 setting_jsonp_enabled: Enable JSONP support
409 setting_jsonp_enabled: Enable JSONP support
409 setting_default_projects_tracker_ids: Default trackers for new projects
410 setting_default_projects_tracker_ids: Default trackers for new projects
410 setting_mail_handler_excluded_filenames: Exclude attachments by name
411 setting_mail_handler_excluded_filenames: Exclude attachments by name
411 setting_force_default_language_for_anonymous: Force default language for anonymous users
412 setting_force_default_language_for_anonymous: Force default language for anonymous users
412 setting_force_default_language_for_loggedin: Force default language for logged-in users
413 setting_force_default_language_for_loggedin: Force default language for logged-in users
413
414
414 permission_add_project: Create project
415 permission_add_project: Create project
415 permission_add_subprojects: Create subprojects
416 permission_add_subprojects: Create subprojects
416 permission_edit_project: Edit project
417 permission_edit_project: Edit project
417 permission_close_project: Close / reopen the project
418 permission_close_project: Close / reopen the project
418 permission_select_project_modules: Select project modules
419 permission_select_project_modules: Select project modules
419 permission_manage_members: Manage members
420 permission_manage_members: Manage members
420 permission_manage_project_activities: Manage project activities
421 permission_manage_project_activities: Manage project activities
421 permission_manage_versions: Manage versions
422 permission_manage_versions: Manage versions
422 permission_manage_categories: Manage issue categories
423 permission_manage_categories: Manage issue categories
423 permission_view_issues: View Issues
424 permission_view_issues: View Issues
424 permission_add_issues: Add issues
425 permission_add_issues: Add issues
425 permission_edit_issues: Edit issues
426 permission_edit_issues: Edit issues
426 permission_manage_issue_relations: Manage issue relations
427 permission_manage_issue_relations: Manage issue relations
427 permission_set_issues_private: Set issues public or private
428 permission_set_issues_private: Set issues public or private
428 permission_set_own_issues_private: Set own issues public or private
429 permission_set_own_issues_private: Set own issues public or private
429 permission_add_issue_notes: Add notes
430 permission_add_issue_notes: Add notes
430 permission_edit_issue_notes: Edit notes
431 permission_edit_issue_notes: Edit notes
431 permission_edit_own_issue_notes: Edit own notes
432 permission_edit_own_issue_notes: Edit own notes
432 permission_view_private_notes: View private notes
433 permission_view_private_notes: View private notes
433 permission_set_notes_private: Set notes as private
434 permission_set_notes_private: Set notes as private
434 permission_move_issues: Move issues
435 permission_move_issues: Move issues
435 permission_delete_issues: Delete issues
436 permission_delete_issues: Delete issues
436 permission_manage_public_queries: Manage public queries
437 permission_manage_public_queries: Manage public queries
437 permission_save_queries: Save queries
438 permission_save_queries: Save queries
438 permission_view_gantt: View gantt chart
439 permission_view_gantt: View gantt chart
439 permission_view_calendar: View calendar
440 permission_view_calendar: View calendar
440 permission_view_issue_watchers: View watchers list
441 permission_view_issue_watchers: View watchers list
441 permission_add_issue_watchers: Add watchers
442 permission_add_issue_watchers: Add watchers
442 permission_delete_issue_watchers: Delete watchers
443 permission_delete_issue_watchers: Delete watchers
443 permission_log_time: Log spent time
444 permission_log_time: Log spent time
444 permission_view_time_entries: View spent time
445 permission_view_time_entries: View spent time
445 permission_edit_time_entries: Edit time logs
446 permission_edit_time_entries: Edit time logs
446 permission_edit_own_time_entries: Edit own time logs
447 permission_edit_own_time_entries: Edit own time logs
447 permission_manage_news: Manage news
448 permission_manage_news: Manage news
448 permission_comment_news: Comment news
449 permission_comment_news: Comment news
449 permission_view_documents: View documents
450 permission_view_documents: View documents
450 permission_add_documents: Add documents
451 permission_add_documents: Add documents
451 permission_edit_documents: Edit documents
452 permission_edit_documents: Edit documents
452 permission_delete_documents: Delete documents
453 permission_delete_documents: Delete documents
453 permission_manage_files: Manage files
454 permission_manage_files: Manage files
454 permission_view_files: View files
455 permission_view_files: View files
455 permission_manage_wiki: Manage wiki
456 permission_manage_wiki: Manage wiki
456 permission_rename_wiki_pages: Rename wiki pages
457 permission_rename_wiki_pages: Rename wiki pages
457 permission_delete_wiki_pages: Delete wiki pages
458 permission_delete_wiki_pages: Delete wiki pages
458 permission_view_wiki_pages: View wiki
459 permission_view_wiki_pages: View wiki
459 permission_view_wiki_edits: View wiki history
460 permission_view_wiki_edits: View wiki history
460 permission_edit_wiki_pages: Edit wiki pages
461 permission_edit_wiki_pages: Edit wiki pages
461 permission_delete_wiki_pages_attachments: Delete attachments
462 permission_delete_wiki_pages_attachments: Delete attachments
462 permission_protect_wiki_pages: Protect wiki pages
463 permission_protect_wiki_pages: Protect wiki pages
463 permission_manage_repository: Manage repository
464 permission_manage_repository: Manage repository
464 permission_browse_repository: Browse repository
465 permission_browse_repository: Browse repository
465 permission_view_changesets: View changesets
466 permission_view_changesets: View changesets
466 permission_commit_access: Commit access
467 permission_commit_access: Commit access
467 permission_manage_boards: Manage forums
468 permission_manage_boards: Manage forums
468 permission_view_messages: View messages
469 permission_view_messages: View messages
469 permission_add_messages: Post messages
470 permission_add_messages: Post messages
470 permission_edit_messages: Edit messages
471 permission_edit_messages: Edit messages
471 permission_edit_own_messages: Edit own messages
472 permission_edit_own_messages: Edit own messages
472 permission_delete_messages: Delete messages
473 permission_delete_messages: Delete messages
473 permission_delete_own_messages: Delete own messages
474 permission_delete_own_messages: Delete own messages
474 permission_export_wiki_pages: Export wiki pages
475 permission_export_wiki_pages: Export wiki pages
475 permission_manage_subtasks: Manage subtasks
476 permission_manage_subtasks: Manage subtasks
476 permission_manage_related_issues: Manage related issues
477 permission_manage_related_issues: Manage related issues
477
478
478 project_module_issue_tracking: Issue tracking
479 project_module_issue_tracking: Issue tracking
479 project_module_time_tracking: Time tracking
480 project_module_time_tracking: Time tracking
480 project_module_news: News
481 project_module_news: News
481 project_module_documents: Documents
482 project_module_documents: Documents
482 project_module_files: Files
483 project_module_files: Files
483 project_module_wiki: Wiki
484 project_module_wiki: Wiki
484 project_module_repository: Repository
485 project_module_repository: Repository
485 project_module_boards: Forums
486 project_module_boards: Forums
486 project_module_calendar: Calendar
487 project_module_calendar: Calendar
487 project_module_gantt: Gantt
488 project_module_gantt: Gantt
488
489
489 label_user: User
490 label_user: User
490 label_user_plural: Users
491 label_user_plural: Users
491 label_user_new: New user
492 label_user_new: New user
492 label_user_anonymous: Anonymous
493 label_user_anonymous: Anonymous
493 label_project: Project
494 label_project: Project
494 label_project_new: New project
495 label_project_new: New project
495 label_project_plural: Projects
496 label_project_plural: Projects
496 label_x_projects:
497 label_x_projects:
497 zero: no projects
498 zero: no projects
498 one: 1 project
499 one: 1 project
499 other: "%{count} projects"
500 other: "%{count} projects"
500 label_project_all: All Projects
501 label_project_all: All Projects
501 label_project_latest: Latest projects
502 label_project_latest: Latest projects
502 label_issue: Issue
503 label_issue: Issue
503 label_issue_new: New issue
504 label_issue_new: New issue
504 label_issue_plural: Issues
505 label_issue_plural: Issues
505 label_issue_view_all: View all issues
506 label_issue_view_all: View all issues
506 label_issues_by: "Issues by %{value}"
507 label_issues_by: "Issues by %{value}"
507 label_issue_added: Issue added
508 label_issue_added: Issue added
508 label_issue_updated: Issue updated
509 label_issue_updated: Issue updated
509 label_issue_note_added: Note added
510 label_issue_note_added: Note added
510 label_issue_status_updated: Status updated
511 label_issue_status_updated: Status updated
511 label_issue_assigned_to_updated: Assignee updated
512 label_issue_assigned_to_updated: Assignee updated
512 label_issue_priority_updated: Priority updated
513 label_issue_priority_updated: Priority updated
513 label_document: Document
514 label_document: Document
514 label_document_new: New document
515 label_document_new: New document
515 label_document_plural: Documents
516 label_document_plural: Documents
516 label_document_added: Document added
517 label_document_added: Document added
517 label_role: Role
518 label_role: Role
518 label_role_plural: Roles
519 label_role_plural: Roles
519 label_role_new: New role
520 label_role_new: New role
520 label_role_and_permissions: Roles and permissions
521 label_role_and_permissions: Roles and permissions
521 label_role_anonymous: Anonymous
522 label_role_anonymous: Anonymous
522 label_role_non_member: Non member
523 label_role_non_member: Non member
523 label_member: Member
524 label_member: Member
524 label_member_new: New member
525 label_member_new: New member
525 label_member_plural: Members
526 label_member_plural: Members
526 label_tracker: Tracker
527 label_tracker: Tracker
527 label_tracker_plural: Trackers
528 label_tracker_plural: Trackers
528 label_tracker_new: New tracker
529 label_tracker_new: New tracker
529 label_workflow: Workflow
530 label_workflow: Workflow
530 label_issue_status: Issue status
531 label_issue_status: Issue status
531 label_issue_status_plural: Issue statuses
532 label_issue_status_plural: Issue statuses
532 label_issue_status_new: New status
533 label_issue_status_new: New status
533 label_issue_category: Issue category
534 label_issue_category: Issue category
534 label_issue_category_plural: Issue categories
535 label_issue_category_plural: Issue categories
535 label_issue_category_new: New category
536 label_issue_category_new: New category
536 label_custom_field: Custom field
537 label_custom_field: Custom field
537 label_custom_field_plural: Custom fields
538 label_custom_field_plural: Custom fields
538 label_custom_field_new: New custom field
539 label_custom_field_new: New custom field
539 label_enumerations: Enumerations
540 label_enumerations: Enumerations
540 label_enumeration_new: New value
541 label_enumeration_new: New value
541 label_information: Information
542 label_information: Information
542 label_information_plural: Information
543 label_information_plural: Information
543 label_please_login: Please log in
544 label_please_login: Please log in
544 label_register: Register
545 label_register: Register
545 label_login_with_open_id_option: or login with OpenID
546 label_login_with_open_id_option: or login with OpenID
546 label_password_lost: Lost password
547 label_password_lost: Lost password
547 label_home: Home
548 label_home: Home
548 label_my_page: My page
549 label_my_page: My page
549 label_my_account: My account
550 label_my_account: My account
550 label_my_projects: My projects
551 label_my_projects: My projects
551 label_my_page_block: My page block
552 label_my_page_block: My page block
552 label_administration: Administration
553 label_administration: Administration
553 label_login: Sign in
554 label_login: Sign in
554 label_logout: Sign out
555 label_logout: Sign out
555 label_help: Help
556 label_help: Help
556 label_reported_issues: Reported issues
557 label_reported_issues: Reported issues
557 label_assigned_to_me_issues: Issues assigned to me
558 label_assigned_to_me_issues: Issues assigned to me
558 label_last_login: Last connection
559 label_last_login: Last connection
559 label_registered_on: Registered on
560 label_registered_on: Registered on
560 label_activity: Activity
561 label_activity: Activity
561 label_overall_activity: Overall activity
562 label_overall_activity: Overall activity
562 label_user_activity: "%{value}'s activity"
563 label_user_activity: "%{value}'s activity"
563 label_new: New
564 label_new: New
564 label_logged_as: Logged in as
565 label_logged_as: Logged in as
565 label_environment: Environment
566 label_environment: Environment
566 label_authentication: Authentication
567 label_authentication: Authentication
567 label_auth_source: Authentication mode
568 label_auth_source: Authentication mode
568 label_auth_source_new: New authentication mode
569 label_auth_source_new: New authentication mode
569 label_auth_source_plural: Authentication modes
570 label_auth_source_plural: Authentication modes
570 label_subproject_plural: Subprojects
571 label_subproject_plural: Subprojects
571 label_subproject_new: New subproject
572 label_subproject_new: New subproject
572 label_and_its_subprojects: "%{value} and its subprojects"
573 label_and_its_subprojects: "%{value} and its subprojects"
573 label_min_max_length: Min - Max length
574 label_min_max_length: Min - Max length
574 label_list: List
575 label_list: List
575 label_date: Date
576 label_date: Date
576 label_integer: Integer
577 label_integer: Integer
577 label_float: Float
578 label_float: Float
578 label_boolean: Boolean
579 label_boolean: Boolean
579 label_string: Text
580 label_string: Text
580 label_text: Long text
581 label_text: Long text
581 label_attribute: Attribute
582 label_attribute: Attribute
582 label_attribute_plural: Attributes
583 label_attribute_plural: Attributes
583 label_no_data: No data to display
584 label_no_data: No data to display
584 label_change_status: Change status
585 label_change_status: Change status
585 label_history: History
586 label_history: History
586 label_attachment: File
587 label_attachment: File
587 label_attachment_new: New file
588 label_attachment_new: New file
588 label_attachment_delete: Delete file
589 label_attachment_delete: Delete file
589 label_attachment_plural: Files
590 label_attachment_plural: Files
590 label_file_added: File added
591 label_file_added: File added
591 label_report: Report
592 label_report: Report
592 label_report_plural: Reports
593 label_report_plural: Reports
593 label_news: News
594 label_news: News
594 label_news_new: Add news
595 label_news_new: Add news
595 label_news_plural: News
596 label_news_plural: News
596 label_news_latest: Latest news
597 label_news_latest: Latest news
597 label_news_view_all: View all news
598 label_news_view_all: View all news
598 label_news_added: News added
599 label_news_added: News added
599 label_news_comment_added: Comment added to a news
600 label_news_comment_added: Comment added to a news
600 label_settings: Settings
601 label_settings: Settings
601 label_overview: Overview
602 label_overview: Overview
602 label_version: Version
603 label_version: Version
603 label_version_new: New version
604 label_version_new: New version
604 label_version_plural: Versions
605 label_version_plural: Versions
605 label_close_versions: Close completed versions
606 label_close_versions: Close completed versions
606 label_confirmation: Confirmation
607 label_confirmation: Confirmation
607 label_export_to: 'Also available in:'
608 label_export_to: 'Also available in:'
608 label_read: Read...
609 label_read: Read...
609 label_public_projects: Public projects
610 label_public_projects: Public projects
610 label_open_issues: open
611 label_open_issues: open
611 label_open_issues_plural: open
612 label_open_issues_plural: open
612 label_closed_issues: closed
613 label_closed_issues: closed
613 label_closed_issues_plural: closed
614 label_closed_issues_plural: closed
614 label_x_open_issues_abbr_on_total:
615 label_x_open_issues_abbr_on_total:
615 zero: 0 open / %{total}
616 zero: 0 open / %{total}
616 one: 1 open / %{total}
617 one: 1 open / %{total}
617 other: "%{count} open / %{total}"
618 other: "%{count} open / %{total}"
618 label_x_open_issues_abbr:
619 label_x_open_issues_abbr:
619 zero: 0 open
620 zero: 0 open
620 one: 1 open
621 one: 1 open
621 other: "%{count} open"
622 other: "%{count} open"
622 label_x_closed_issues_abbr:
623 label_x_closed_issues_abbr:
623 zero: 0 closed
624 zero: 0 closed
624 one: 1 closed
625 one: 1 closed
625 other: "%{count} closed"
626 other: "%{count} closed"
626 label_x_issues:
627 label_x_issues:
627 zero: 0 issues
628 zero: 0 issues
628 one: 1 issue
629 one: 1 issue
629 other: "%{count} issues"
630 other: "%{count} issues"
630 label_total: Total
631 label_total: Total
631 label_total_time: Total time
632 label_total_time: Total time
632 label_permissions: Permissions
633 label_permissions: Permissions
633 label_current_status: Current status
634 label_current_status: Current status
634 label_new_statuses_allowed: New statuses allowed
635 label_new_statuses_allowed: New statuses allowed
635 label_all: all
636 label_all: all
636 label_any: any
637 label_any: any
637 label_none: none
638 label_none: none
638 label_nobody: nobody
639 label_nobody: nobody
639 label_next: Next
640 label_next: Next
640 label_previous: Previous
641 label_previous: Previous
641 label_used_by: Used by
642 label_used_by: Used by
642 label_details: Details
643 label_details: Details
643 label_add_note: Add a note
644 label_add_note: Add a note
644 label_per_page: Per page
645 label_per_page: Per page
645 label_calendar: Calendar
646 label_calendar: Calendar
646 label_months_from: months from
647 label_months_from: months from
647 label_gantt: Gantt
648 label_gantt: Gantt
648 label_internal: Internal
649 label_internal: Internal
649 label_last_changes: "last %{count} changes"
650 label_last_changes: "last %{count} changes"
650 label_change_view_all: View all changes
651 label_change_view_all: View all changes
651 label_personalize_page: Personalize this page
652 label_personalize_page: Personalize this page
652 label_comment: Comment
653 label_comment: Comment
653 label_comment_plural: Comments
654 label_comment_plural: Comments
654 label_x_comments:
655 label_x_comments:
655 zero: no comments
656 zero: no comments
656 one: 1 comment
657 one: 1 comment
657 other: "%{count} comments"
658 other: "%{count} comments"
658 label_comment_add: Add a comment
659 label_comment_add: Add a comment
659 label_comment_added: Comment added
660 label_comment_added: Comment added
660 label_comment_delete: Delete comments
661 label_comment_delete: Delete comments
661 label_query: Custom query
662 label_query: Custom query
662 label_query_plural: Custom queries
663 label_query_plural: Custom queries
663 label_query_new: New query
664 label_query_new: New query
664 label_my_queries: My custom queries
665 label_my_queries: My custom queries
665 label_filter_add: Add filter
666 label_filter_add: Add filter
666 label_filter_plural: Filters
667 label_filter_plural: Filters
667 label_equals: is
668 label_equals: is
668 label_not_equals: is not
669 label_not_equals: is not
669 label_in_less_than: in less than
670 label_in_less_than: in less than
670 label_in_more_than: in more than
671 label_in_more_than: in more than
671 label_in_the_next_days: in the next
672 label_in_the_next_days: in the next
672 label_in_the_past_days: in the past
673 label_in_the_past_days: in the past
673 label_greater_or_equal: '>='
674 label_greater_or_equal: '>='
674 label_less_or_equal: '<='
675 label_less_or_equal: '<='
675 label_between: between
676 label_between: between
676 label_in: in
677 label_in: in
677 label_today: today
678 label_today: today
678 label_all_time: all time
679 label_all_time: all time
679 label_yesterday: yesterday
680 label_yesterday: yesterday
680 label_this_week: this week
681 label_this_week: this week
681 label_last_week: last week
682 label_last_week: last week
682 label_last_n_weeks: "last %{count} weeks"
683 label_last_n_weeks: "last %{count} weeks"
683 label_last_n_days: "last %{count} days"
684 label_last_n_days: "last %{count} days"
684 label_this_month: this month
685 label_this_month: this month
685 label_last_month: last month
686 label_last_month: last month
686 label_this_year: this year
687 label_this_year: this year
687 label_date_range: Date range
688 label_date_range: Date range
688 label_less_than_ago: less than days ago
689 label_less_than_ago: less than days ago
689 label_more_than_ago: more than days ago
690 label_more_than_ago: more than days ago
690 label_ago: days ago
691 label_ago: days ago
691 label_contains: contains
692 label_contains: contains
692 label_not_contains: doesn't contain
693 label_not_contains: doesn't contain
693 label_any_issues_in_project: any issues in project
694 label_any_issues_in_project: any issues in project
694 label_any_issues_not_in_project: any issues not in project
695 label_any_issues_not_in_project: any issues not in project
695 label_no_issues_in_project: no issues in project
696 label_no_issues_in_project: no issues in project
696 label_day_plural: days
697 label_day_plural: days
697 label_repository: Repository
698 label_repository: Repository
698 label_repository_new: New repository
699 label_repository_new: New repository
699 label_repository_plural: Repositories
700 label_repository_plural: Repositories
700 label_browse: Browse
701 label_browse: Browse
701 label_branch: Branch
702 label_branch: Branch
702 label_tag: Tag
703 label_tag: Tag
703 label_revision: Revision
704 label_revision: Revision
704 label_revision_plural: Revisions
705 label_revision_plural: Revisions
705 label_revision_id: "Revision %{value}"
706 label_revision_id: "Revision %{value}"
706 label_associated_revisions: Associated revisions
707 label_associated_revisions: Associated revisions
707 label_added: added
708 label_added: added
708 label_modified: modified
709 label_modified: modified
709 label_copied: copied
710 label_copied: copied
710 label_renamed: renamed
711 label_renamed: renamed
711 label_deleted: deleted
712 label_deleted: deleted
712 label_latest_revision: Latest revision
713 label_latest_revision: Latest revision
713 label_latest_revision_plural: Latest revisions
714 label_latest_revision_plural: Latest revisions
714 label_view_revisions: View revisions
715 label_view_revisions: View revisions
715 label_view_all_revisions: View all revisions
716 label_view_all_revisions: View all revisions
716 label_max_size: Maximum size
717 label_max_size: Maximum size
717 label_sort_highest: Move to top
718 label_sort_highest: Move to top
718 label_sort_higher: Move up
719 label_sort_higher: Move up
719 label_sort_lower: Move down
720 label_sort_lower: Move down
720 label_sort_lowest: Move to bottom
721 label_sort_lowest: Move to bottom
721 label_roadmap: Roadmap
722 label_roadmap: Roadmap
722 label_roadmap_due_in: "Due in %{value}"
723 label_roadmap_due_in: "Due in %{value}"
723 label_roadmap_overdue: "%{value} late"
724 label_roadmap_overdue: "%{value} late"
724 label_roadmap_no_issues: No issues for this version
725 label_roadmap_no_issues: No issues for this version
725 label_search: Search
726 label_search: Search
726 label_result_plural: Results
727 label_result_plural: Results
727 label_all_words: All words
728 label_all_words: All words
728 label_wiki: Wiki
729 label_wiki: Wiki
729 label_wiki_edit: Wiki edit
730 label_wiki_edit: Wiki edit
730 label_wiki_edit_plural: Wiki edits
731 label_wiki_edit_plural: Wiki edits
731 label_wiki_page: Wiki page
732 label_wiki_page: Wiki page
732 label_wiki_page_plural: Wiki pages
733 label_wiki_page_plural: Wiki pages
733 label_index_by_title: Index by title
734 label_index_by_title: Index by title
734 label_index_by_date: Index by date
735 label_index_by_date: Index by date
735 label_current_version: Current version
736 label_current_version: Current version
736 label_preview: Preview
737 label_preview: Preview
737 label_feed_plural: Feeds
738 label_feed_plural: Feeds
738 label_changes_details: Details of all changes
739 label_changes_details: Details of all changes
739 label_issue_tracking: Issue tracking
740 label_issue_tracking: Issue tracking
740 label_spent_time: Spent time
741 label_spent_time: Spent time
741 label_overall_spent_time: Overall spent time
742 label_overall_spent_time: Overall spent time
742 label_f_hour: "%{value} hour"
743 label_f_hour: "%{value} hour"
743 label_f_hour_plural: "%{value} hours"
744 label_f_hour_plural: "%{value} hours"
744 label_time_tracking: Time tracking
745 label_time_tracking: Time tracking
745 label_change_plural: Changes
746 label_change_plural: Changes
746 label_statistics: Statistics
747 label_statistics: Statistics
747 label_commits_per_month: Commits per month
748 label_commits_per_month: Commits per month
748 label_commits_per_author: Commits per author
749 label_commits_per_author: Commits per author
749 label_diff: diff
750 label_diff: diff
750 label_view_diff: View differences
751 label_view_diff: View differences
751 label_diff_inline: inline
752 label_diff_inline: inline
752 label_diff_side_by_side: side by side
753 label_diff_side_by_side: side by side
753 label_options: Options
754 label_options: Options
754 label_copy_workflow_from: Copy workflow from
755 label_copy_workflow_from: Copy workflow from
755 label_permissions_report: Permissions report
756 label_permissions_report: Permissions report
756 label_watched_issues: Watched issues
757 label_watched_issues: Watched issues
757 label_related_issues: Related issues
758 label_related_issues: Related issues
758 label_applied_status: Applied status
759 label_applied_status: Applied status
759 label_loading: Loading...
760 label_loading: Loading...
760 label_relation_new: New relation
761 label_relation_new: New relation
761 label_relation_delete: Delete relation
762 label_relation_delete: Delete relation
762 label_relates_to: Related to
763 label_relates_to: Related to
763 label_duplicates: Duplicates
764 label_duplicates: Duplicates
764 label_duplicated_by: Duplicated by
765 label_duplicated_by: Duplicated by
765 label_blocks: Blocks
766 label_blocks: Blocks
766 label_blocked_by: Blocked by
767 label_blocked_by: Blocked by
767 label_precedes: Precedes
768 label_precedes: Precedes
768 label_follows: Follows
769 label_follows: Follows
769 label_copied_to: Copied to
770 label_copied_to: Copied to
770 label_copied_from: Copied from
771 label_copied_from: Copied from
771 label_end_to_start: end to start
772 label_end_to_start: end to start
772 label_end_to_end: end to end
773 label_end_to_end: end to end
773 label_start_to_start: start to start
774 label_start_to_start: start to start
774 label_start_to_end: start to end
775 label_start_to_end: start to end
775 label_stay_logged_in: Stay logged in
776 label_stay_logged_in: Stay logged in
776 label_disabled: disabled
777 label_disabled: disabled
777 label_show_completed_versions: Show completed versions
778 label_show_completed_versions: Show completed versions
778 label_me: me
779 label_me: me
779 label_board: Forum
780 label_board: Forum
780 label_board_new: New forum
781 label_board_new: New forum
781 label_board_plural: Forums
782 label_board_plural: Forums
782 label_board_locked: Locked
783 label_board_locked: Locked
783 label_board_sticky: Sticky
784 label_board_sticky: Sticky
784 label_topic_plural: Topics
785 label_topic_plural: Topics
785 label_message_plural: Messages
786 label_message_plural: Messages
786 label_message_last: Last message
787 label_message_last: Last message
787 label_message_new: New message
788 label_message_new: New message
788 label_message_posted: Message added
789 label_message_posted: Message added
789 label_reply_plural: Replies
790 label_reply_plural: Replies
790 label_send_information: Send account information to the user
791 label_send_information: Send account information to the user
791 label_year: Year
792 label_year: Year
792 label_month: Month
793 label_month: Month
793 label_week: Week
794 label_week: Week
794 label_date_from: From
795 label_date_from: From
795 label_date_to: To
796 label_date_to: To
796 label_language_based: Based on user's language
797 label_language_based: Based on user's language
797 label_sort_by: "Sort by %{value}"
798 label_sort_by: "Sort by %{value}"
798 label_send_test_email: Send a test email
799 label_send_test_email: Send a test email
799 label_feeds_access_key: Atom access key
800 label_feeds_access_key: Atom access key
800 label_missing_feeds_access_key: Missing a Atom access key
801 label_missing_feeds_access_key: Missing a Atom access key
801 label_feeds_access_key_created_on: "Atom access key created %{value} ago"
802 label_feeds_access_key_created_on: "Atom access key created %{value} ago"
802 label_module_plural: Modules
803 label_module_plural: Modules
803 label_added_time_by: "Added by %{author} %{age} ago"
804 label_added_time_by: "Added by %{author} %{age} ago"
804 label_updated_time_by: "Updated by %{author} %{age} ago"
805 label_updated_time_by: "Updated by %{author} %{age} ago"
805 label_updated_time: "Updated %{value} ago"
806 label_updated_time: "Updated %{value} ago"
806 label_jump_to_a_project: Jump to a project...
807 label_jump_to_a_project: Jump to a project...
807 label_file_plural: Files
808 label_file_plural: Files
808 label_changeset_plural: Changesets
809 label_changeset_plural: Changesets
809 label_default_columns: Default columns
810 label_default_columns: Default columns
810 label_no_change_option: (No change)
811 label_no_change_option: (No change)
811 label_bulk_edit_selected_issues: Bulk edit selected issues
812 label_bulk_edit_selected_issues: Bulk edit selected issues
812 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
813 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
813 label_theme: Theme
814 label_theme: Theme
814 label_default: Default
815 label_default: Default
815 label_search_titles_only: Search titles only
816 label_search_titles_only: Search titles only
816 label_user_mail_option_all: "For any event on all my projects"
817 label_user_mail_option_all: "For any event on all my projects"
817 label_user_mail_option_selected: "For any event on the selected projects only..."
818 label_user_mail_option_selected: "For any event on the selected projects only..."
818 label_user_mail_option_none: "No events"
819 label_user_mail_option_none: "No events"
819 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
820 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
820 label_user_mail_option_only_assigned: "Only for things I am assigned to"
821 label_user_mail_option_only_assigned: "Only for things I am assigned to"
821 label_user_mail_option_only_owner: "Only for things I am the owner of"
822 label_user_mail_option_only_owner: "Only for things I am the owner of"
822 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
823 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
823 label_registration_activation_by_email: account activation by email
824 label_registration_activation_by_email: account activation by email
824 label_registration_manual_activation: manual account activation
825 label_registration_manual_activation: manual account activation
825 label_registration_automatic_activation: automatic account activation
826 label_registration_automatic_activation: automatic account activation
826 label_display_per_page: "Per page: %{value}"
827 label_display_per_page: "Per page: %{value}"
827 label_age: Age
828 label_age: Age
828 label_change_properties: Change properties
829 label_change_properties: Change properties
829 label_general: General
830 label_general: General
830 label_more: More
831 label_more: More
831 label_scm: SCM
832 label_scm: SCM
832 label_plugins: Plugins
833 label_plugins: Plugins
833 label_ldap_authentication: LDAP authentication
834 label_ldap_authentication: LDAP authentication
834 label_downloads_abbr: D/L
835 label_downloads_abbr: D/L
835 label_optional_description: Optional description
836 label_optional_description: Optional description
836 label_add_another_file: Add another file
837 label_add_another_file: Add another file
837 label_preferences: Preferences
838 label_preferences: Preferences
838 label_chronological_order: In chronological order
839 label_chronological_order: In chronological order
839 label_reverse_chronological_order: In reverse chronological order
840 label_reverse_chronological_order: In reverse chronological order
840 label_planning: Planning
841 label_planning: Planning
841 label_incoming_emails: Incoming emails
842 label_incoming_emails: Incoming emails
842 label_generate_key: Generate a key
843 label_generate_key: Generate a key
843 label_issue_watchers: Watchers
844 label_issue_watchers: Watchers
844 label_example: Example
845 label_example: Example
845 label_display: Display
846 label_display: Display
846 label_sort: Sort
847 label_sort: Sort
847 label_ascending: Ascending
848 label_ascending: Ascending
848 label_descending: Descending
849 label_descending: Descending
849 label_date_from_to: From %{start} to %{end}
850 label_date_from_to: From %{start} to %{end}
850 label_wiki_content_added: Wiki page added
851 label_wiki_content_added: Wiki page added
851 label_wiki_content_updated: Wiki page updated
852 label_wiki_content_updated: Wiki page updated
852 label_group: Group
853 label_group: Group
853 label_group_plural: Groups
854 label_group_plural: Groups
854 label_group_new: New group
855 label_group_new: New group
855 label_group_anonymous: Anonymous users
856 label_group_anonymous: Anonymous users
856 label_group_non_member: Non member users
857 label_group_non_member: Non member users
857 label_time_entry_plural: Spent time
858 label_time_entry_plural: Spent time
858 label_version_sharing_none: Not shared
859 label_version_sharing_none: Not shared
859 label_version_sharing_descendants: With subprojects
860 label_version_sharing_descendants: With subprojects
860 label_version_sharing_hierarchy: With project hierarchy
861 label_version_sharing_hierarchy: With project hierarchy
861 label_version_sharing_tree: With project tree
862 label_version_sharing_tree: With project tree
862 label_version_sharing_system: With all projects
863 label_version_sharing_system: With all projects
863 label_update_issue_done_ratios: Update issue done ratios
864 label_update_issue_done_ratios: Update issue done ratios
864 label_copy_source: Source
865 label_copy_source: Source
865 label_copy_target: Target
866 label_copy_target: Target
866 label_copy_same_as_target: Same as target
867 label_copy_same_as_target: Same as target
867 label_display_used_statuses_only: Only display statuses that are used by this tracker
868 label_display_used_statuses_only: Only display statuses that are used by this tracker
868 label_api_access_key: API access key
869 label_api_access_key: API access key
869 label_missing_api_access_key: Missing an API access key
870 label_missing_api_access_key: Missing an API access key
870 label_api_access_key_created_on: "API access key created %{value} ago"
871 label_api_access_key_created_on: "API access key created %{value} ago"
871 label_profile: Profile
872 label_profile: Profile
872 label_subtask_plural: Subtasks
873 label_subtask_plural: Subtasks
873 label_project_copy_notifications: Send email notifications during the project copy
874 label_project_copy_notifications: Send email notifications during the project copy
874 label_principal_search: "Search for user or group:"
875 label_principal_search: "Search for user or group:"
875 label_user_search: "Search for user:"
876 label_user_search: "Search for user:"
876 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
877 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
877 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
878 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
878 label_issues_visibility_all: All issues
879 label_issues_visibility_all: All issues
879 label_issues_visibility_public: All non private issues
880 label_issues_visibility_public: All non private issues
880 label_issues_visibility_own: Issues created by or assigned to the user
881 label_issues_visibility_own: Issues created by or assigned to the user
881 label_git_report_last_commit: Report last commit for files and directories
882 label_git_report_last_commit: Report last commit for files and directories
882 label_parent_revision: Parent
883 label_parent_revision: Parent
883 label_child_revision: Child
884 label_child_revision: Child
884 label_export_options: "%{export_format} export options"
885 label_export_options: "%{export_format} export options"
885 label_copy_attachments: Copy attachments
886 label_copy_attachments: Copy attachments
886 label_copy_subtasks: Copy subtasks
887 label_copy_subtasks: Copy subtasks
887 label_item_position: "%{position} of %{count}"
888 label_item_position: "%{position} of %{count}"
888 label_completed_versions: Completed versions
889 label_completed_versions: Completed versions
889 label_search_for_watchers: Search for watchers to add
890 label_search_for_watchers: Search for watchers to add
890 label_session_expiration: Session expiration
891 label_session_expiration: Session expiration
891 label_show_closed_projects: View closed projects
892 label_show_closed_projects: View closed projects
892 label_status_transitions: Status transitions
893 label_status_transitions: Status transitions
893 label_fields_permissions: Fields permissions
894 label_fields_permissions: Fields permissions
894 label_readonly: Read-only
895 label_readonly: Read-only
895 label_required: Required
896 label_required: Required
896 label_hidden: Hidden
897 label_hidden: Hidden
897 label_attribute_of_project: "Project's %{name}"
898 label_attribute_of_project: "Project's %{name}"
898 label_attribute_of_issue: "Issue's %{name}"
899 label_attribute_of_issue: "Issue's %{name}"
899 label_attribute_of_author: "Author's %{name}"
900 label_attribute_of_author: "Author's %{name}"
900 label_attribute_of_assigned_to: "Assignee's %{name}"
901 label_attribute_of_assigned_to: "Assignee's %{name}"
901 label_attribute_of_user: "User's %{name}"
902 label_attribute_of_user: "User's %{name}"
902 label_attribute_of_fixed_version: "Target version's %{name}"
903 label_attribute_of_fixed_version: "Target version's %{name}"
903 label_cross_project_descendants: With subprojects
904 label_cross_project_descendants: With subprojects
904 label_cross_project_tree: With project tree
905 label_cross_project_tree: With project tree
905 label_cross_project_hierarchy: With project hierarchy
906 label_cross_project_hierarchy: With project hierarchy
906 label_cross_project_system: With all projects
907 label_cross_project_system: With all projects
907 label_gantt_progress_line: Progress line
908 label_gantt_progress_line: Progress line
908 label_visibility_private: to me only
909 label_visibility_private: to me only
909 label_visibility_roles: to these roles only
910 label_visibility_roles: to these roles only
910 label_visibility_public: to any users
911 label_visibility_public: to any users
911 label_link: Link
912 label_link: Link
912 label_only: only
913 label_only: only
913 label_drop_down_list: drop-down list
914 label_drop_down_list: drop-down list
914 label_checkboxes: checkboxes
915 label_checkboxes: checkboxes
915 label_radio_buttons: radio buttons
916 label_radio_buttons: radio buttons
916 label_link_values_to: Link values to URL
917 label_link_values_to: Link values to URL
917 label_custom_field_select_type: Select the type of object to which the custom field is to be attached
918 label_custom_field_select_type: Select the type of object to which the custom field is to be attached
918 label_check_for_updates: Check for updates
919 label_check_for_updates: Check for updates
919 label_latest_compatible_version: Latest compatible version
920 label_latest_compatible_version: Latest compatible version
920 label_unknown_plugin: Unknown plugin
921 label_unknown_plugin: Unknown plugin
921 label_add_projects: Add projects
922 label_add_projects: Add projects
922
923
923 button_login: Login
924 button_login: Login
924 button_submit: Submit
925 button_submit: Submit
925 button_save: Save
926 button_save: Save
926 button_check_all: Check all
927 button_check_all: Check all
927 button_uncheck_all: Uncheck all
928 button_uncheck_all: Uncheck all
928 button_collapse_all: Collapse all
929 button_collapse_all: Collapse all
929 button_expand_all: Expand all
930 button_expand_all: Expand all
930 button_delete: Delete
931 button_delete: Delete
931 button_create: Create
932 button_create: Create
932 button_create_and_continue: Create and continue
933 button_create_and_continue: Create and continue
933 button_test: Test
934 button_test: Test
934 button_edit: Edit
935 button_edit: Edit
935 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
936 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
936 button_add: Add
937 button_add: Add
937 button_change: Change
938 button_change: Change
938 button_apply: Apply
939 button_apply: Apply
939 button_clear: Clear
940 button_clear: Clear
940 button_lock: Lock
941 button_lock: Lock
941 button_unlock: Unlock
942 button_unlock: Unlock
942 button_download: Download
943 button_download: Download
943 button_list: List
944 button_list: List
944 button_view: View
945 button_view: View
945 button_move: Move
946 button_move: Move
946 button_move_and_follow: Move and follow
947 button_move_and_follow: Move and follow
947 button_back: Back
948 button_back: Back
948 button_cancel: Cancel
949 button_cancel: Cancel
949 button_activate: Activate
950 button_activate: Activate
950 button_sort: Sort
951 button_sort: Sort
951 button_log_time: Log time
952 button_log_time: Log time
952 button_rollback: Rollback to this version
953 button_rollback: Rollback to this version
953 button_watch: Watch
954 button_watch: Watch
954 button_unwatch: Unwatch
955 button_unwatch: Unwatch
955 button_reply: Reply
956 button_reply: Reply
956 button_archive: Archive
957 button_archive: Archive
957 button_unarchive: Unarchive
958 button_unarchive: Unarchive
958 button_reset: Reset
959 button_reset: Reset
959 button_rename: Rename
960 button_rename: Rename
960 button_change_password: Change password
961 button_change_password: Change password
961 button_copy: Copy
962 button_copy: Copy
962 button_copy_and_follow: Copy and follow
963 button_copy_and_follow: Copy and follow
963 button_annotate: Annotate
964 button_annotate: Annotate
964 button_update: Update
965 button_update: Update
965 button_configure: Configure
966 button_configure: Configure
966 button_quote: Quote
967 button_quote: Quote
967 button_duplicate: Duplicate
968 button_duplicate: Duplicate
968 button_show: Show
969 button_show: Show
969 button_hide: Hide
970 button_hide: Hide
970 button_edit_section: Edit this section
971 button_edit_section: Edit this section
971 button_export: Export
972 button_export: Export
972 button_delete_my_account: Delete my account
973 button_delete_my_account: Delete my account
973 button_close: Close
974 button_close: Close
974 button_reopen: Reopen
975 button_reopen: Reopen
975
976
976 status_active: active
977 status_active: active
977 status_registered: registered
978 status_registered: registered
978 status_locked: locked
979 status_locked: locked
979
980
980 project_status_active: active
981 project_status_active: active
981 project_status_closed: closed
982 project_status_closed: closed
982 project_status_archived: archived
983 project_status_archived: archived
983
984
984 version_status_open: open
985 version_status_open: open
985 version_status_locked: locked
986 version_status_locked: locked
986 version_status_closed: closed
987 version_status_closed: closed
987
988
988 field_active: Active
989 field_active: Active
989
990
990 text_select_mail_notifications: Select actions for which email notifications should be sent.
991 text_select_mail_notifications: Select actions for which email notifications should be sent.
991 text_regexp_info: eg. ^[A-Z0-9]+$
992 text_regexp_info: eg. ^[A-Z0-9]+$
992 text_min_max_length_info: 0 means no restriction
993 text_min_max_length_info: 0 means no restriction
993 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
994 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
994 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
995 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
995 text_workflow_edit: Select a role and a tracker to edit the workflow
996 text_workflow_edit: Select a role and a tracker to edit the workflow
996 text_are_you_sure: Are you sure?
997 text_are_you_sure: Are you sure?
997 text_journal_changed: "%{label} changed from %{old} to %{new}"
998 text_journal_changed: "%{label} changed from %{old} to %{new}"
998 text_journal_changed_no_detail: "%{label} updated"
999 text_journal_changed_no_detail: "%{label} updated"
999 text_journal_set_to: "%{label} set to %{value}"
1000 text_journal_set_to: "%{label} set to %{value}"
1000 text_journal_deleted: "%{label} deleted (%{old})"
1001 text_journal_deleted: "%{label} deleted (%{old})"
1001 text_journal_added: "%{label} %{value} added"
1002 text_journal_added: "%{label} %{value} added"
1002 text_tip_issue_begin_day: issue beginning this day
1003 text_tip_issue_begin_day: issue beginning this day
1003 text_tip_issue_end_day: issue ending this day
1004 text_tip_issue_end_day: issue ending this day
1004 text_tip_issue_begin_end_day: issue beginning and ending this day
1005 text_tip_issue_begin_end_day: issue beginning and ending this day
1005 text_project_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed.'
1006 text_project_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed.'
1006 text_caracters_maximum: "%{count} characters maximum."
1007 text_caracters_maximum: "%{count} characters maximum."
1007 text_caracters_minimum: "Must be at least %{count} characters long."
1008 text_caracters_minimum: "Must be at least %{count} characters long."
1008 text_length_between: "Length between %{min} and %{max} characters."
1009 text_length_between: "Length between %{min} and %{max} characters."
1009 text_tracker_no_workflow: No workflow defined for this tracker
1010 text_tracker_no_workflow: No workflow defined for this tracker
1010 text_unallowed_characters: Unallowed characters
1011 text_unallowed_characters: Unallowed characters
1011 text_comma_separated: Multiple values allowed (comma separated).
1012 text_comma_separated: Multiple values allowed (comma separated).
1012 text_line_separated: Multiple values allowed (one line for each value).
1013 text_line_separated: Multiple values allowed (one line for each value).
1013 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
1014 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
1014 text_issue_added: "Issue %{id} has been reported by %{author}."
1015 text_issue_added: "Issue %{id} has been reported by %{author}."
1015 text_issue_updated: "Issue %{id} has been updated by %{author}."
1016 text_issue_updated: "Issue %{id} has been updated by %{author}."
1016 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
1017 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
1017 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
1018 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
1018 text_issue_category_destroy_assignments: Remove category assignments
1019 text_issue_category_destroy_assignments: Remove category assignments
1019 text_issue_category_reassign_to: Reassign issues to this category
1020 text_issue_category_reassign_to: Reassign issues to this category
1020 text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)."
1021 text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)."
1021 text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
1022 text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
1022 text_load_default_configuration: Load the default configuration
1023 text_load_default_configuration: Load the default configuration
1023 text_status_changed_by_changeset: "Applied in changeset %{value}."
1024 text_status_changed_by_changeset: "Applied in changeset %{value}."
1024 text_time_logged_by_changeset: "Applied in changeset %{value}."
1025 text_time_logged_by_changeset: "Applied in changeset %{value}."
1025 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
1026 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
1026 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
1027 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
1027 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
1028 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
1028 text_select_project_modules: 'Select modules to enable for this project:'
1029 text_select_project_modules: 'Select modules to enable for this project:'
1029 text_default_administrator_account_changed: Default administrator account changed
1030 text_default_administrator_account_changed: Default administrator account changed
1030 text_file_repository_writable: Attachments directory writable
1031 text_file_repository_writable: Attachments directory writable
1031 text_plugin_assets_writable: Plugin assets directory writable
1032 text_plugin_assets_writable: Plugin assets directory writable
1032 text_rmagick_available: RMagick available (optional)
1033 text_rmagick_available: RMagick available (optional)
1033 text_convert_available: ImageMagick convert available (optional)
1034 text_convert_available: ImageMagick convert available (optional)
1034 text_destroy_time_entries_question: "%{hours} hours were reported on the issues you are about to delete. What do you want to do?"
1035 text_destroy_time_entries_question: "%{hours} hours were reported on the issues you are about to delete. What do you want to do?"
1035 text_destroy_time_entries: Delete reported hours
1036 text_destroy_time_entries: Delete reported hours
1036 text_assign_time_entries_to_project: Assign reported hours to the project
1037 text_assign_time_entries_to_project: Assign reported hours to the project
1037 text_reassign_time_entries: 'Reassign reported hours to this issue:'
1038 text_reassign_time_entries: 'Reassign reported hours to this issue:'
1038 text_user_wrote: "%{value} wrote:"
1039 text_user_wrote: "%{value} wrote:"
1039 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
1040 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
1040 text_enumeration_category_reassign_to: 'Reassign them to this value:'
1041 text_enumeration_category_reassign_to: 'Reassign them to this value:'
1041 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/configuration.yml and restart the application to enable them."
1042 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/configuration.yml and restart the application to enable them."
1042 text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
1043 text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
1043 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
1044 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
1044 text_custom_field_possible_values_info: 'One line for each value'
1045 text_custom_field_possible_values_info: 'One line for each value'
1045 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
1046 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
1046 text_wiki_page_nullify_children: "Keep child pages as root pages"
1047 text_wiki_page_nullify_children: "Keep child pages as root pages"
1047 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
1048 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
1048 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1049 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1049 text_own_membership_delete_confirmation: "You are about to remove some or all of your permissions and may no longer be able to edit this project after that.\nAre you sure you want to continue?"
1050 text_own_membership_delete_confirmation: "You are about to remove some or all of your permissions and may no longer be able to edit this project after that.\nAre you sure you want to continue?"
1050 text_zoom_in: Zoom in
1051 text_zoom_in: Zoom in
1051 text_zoom_out: Zoom out
1052 text_zoom_out: Zoom out
1052 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1053 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1053 text_scm_path_encoding_note: "Default: UTF-8"
1054 text_scm_path_encoding_note: "Default: UTF-8"
1054 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1055 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1055 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1056 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1056 text_scm_command: Command
1057 text_scm_command: Command
1057 text_scm_command_version: Version
1058 text_scm_command_version: Version
1058 text_scm_config: You can configure your SCM commands in config/configuration.yml. Please restart the application after editing it.
1059 text_scm_config: You can configure your SCM commands in config/configuration.yml. Please restart the application after editing it.
1059 text_scm_command_not_available: SCM command is not available. Please check settings on the administration panel.
1060 text_scm_command_not_available: SCM command is not available. Please check settings on the administration panel.
1060 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1061 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1061 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1062 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1062 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1063 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1063 text_account_destroy_confirmation: "Are you sure you want to proceed?\nYour account will be permanently deleted, with no way to reactivate it."
1064 text_account_destroy_confirmation: "Are you sure you want to proceed?\nYour account will be permanently deleted, with no way to reactivate it."
1064 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1065 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1065 text_project_closed: This project is closed and read-only.
1066 text_project_closed: This project is closed and read-only.
1066 text_turning_multiple_off: "If you disable multiple values, multiple values will be removed in order to preserve only one value per item."
1067 text_turning_multiple_off: "If you disable multiple values, multiple values will be removed in order to preserve only one value per item."
1067
1068
1068 default_role_manager: Manager
1069 default_role_manager: Manager
1069 default_role_developer: Developer
1070 default_role_developer: Developer
1070 default_role_reporter: Reporter
1071 default_role_reporter: Reporter
1071 default_tracker_bug: Bug
1072 default_tracker_bug: Bug
1072 default_tracker_feature: Feature
1073 default_tracker_feature: Feature
1073 default_tracker_support: Support
1074 default_tracker_support: Support
1074 default_issue_status_new: New
1075 default_issue_status_new: New
1075 default_issue_status_in_progress: In Progress
1076 default_issue_status_in_progress: In Progress
1076 default_issue_status_resolved: Resolved
1077 default_issue_status_resolved: Resolved
1077 default_issue_status_feedback: Feedback
1078 default_issue_status_feedback: Feedback
1078 default_issue_status_closed: Closed
1079 default_issue_status_closed: Closed
1079 default_issue_status_rejected: Rejected
1080 default_issue_status_rejected: Rejected
1080 default_doc_category_user: User documentation
1081 default_doc_category_user: User documentation
1081 default_doc_category_tech: Technical documentation
1082 default_doc_category_tech: Technical documentation
1082 default_priority_low: Low
1083 default_priority_low: Low
1083 default_priority_normal: Normal
1084 default_priority_normal: Normal
1084 default_priority_high: High
1085 default_priority_high: High
1085 default_priority_urgent: Urgent
1086 default_priority_urgent: Urgent
1086 default_priority_immediate: Immediate
1087 default_priority_immediate: Immediate
1087 default_activity_design: Design
1088 default_activity_design: Design
1088 default_activity_development: Development
1089 default_activity_development: Development
1089
1090
1090 enumeration_issue_priorities: Issue priorities
1091 enumeration_issue_priorities: Issue priorities
1091 enumeration_doc_categories: Document categories
1092 enumeration_doc_categories: Document categories
1092 enumeration_activities: Activities (time tracking)
1093 enumeration_activities: Activities (time tracking)
1093 enumeration_system_activity: System Activity
1094 enumeration_system_activity: System Activity
1094 description_filter: Filter
1095 description_filter: Filter
1095 description_search: Searchfield
1096 description_search: Searchfield
1096 description_choose_project: Projects
1097 description_choose_project: Projects
1097 description_project_scope: Search scope
1098 description_project_scope: Search scope
1098 description_notes: Notes
1099 description_notes: Notes
1099 description_message_content: Message content
1100 description_message_content: Message content
1100 description_query_sort_criteria_attribute: Sort attribute
1101 description_query_sort_criteria_attribute: Sort attribute
1101 description_query_sort_criteria_direction: Sort direction
1102 description_query_sort_criteria_direction: Sort direction
1102 description_user_mail_notification: Mail notification settings
1103 description_user_mail_notification: Mail notification settings
1103 description_available_columns: Available Columns
1104 description_available_columns: Available Columns
1104 description_selected_columns: Selected Columns
1105 description_selected_columns: Selected Columns
1105 description_all_columns: All Columns
1106 description_all_columns: All Columns
1106 description_issue_category_reassign: Choose issue category
1107 description_issue_category_reassign: Choose issue category
1107 description_wiki_subpages_reassign: Choose new parent page
1108 description_wiki_subpages_reassign: Choose new parent page
1108 description_date_range_list: Choose range from list
1109 description_date_range_list: Choose range from list
1109 description_date_range_interval: Choose range by selecting start and end date
1110 description_date_range_interval: Choose range by selecting start and end date
1110 description_date_from: Enter start date
1111 description_date_from: Enter start date
1111 description_date_to: Enter end date
1112 description_date_to: Enter end date
1112 text_repository_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
1113 text_repository_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
@@ -1,1132 +1,1133
1 # French translations for Ruby on Rails
1 # French translations for Ruby on Rails
2 # by Christian Lescuyer (christian@flyingcoders.com)
2 # by Christian Lescuyer (christian@flyingcoders.com)
3 # contributor: Sebastien Grosjean - ZenCocoon.com
3 # contributor: Sebastien Grosjean - ZenCocoon.com
4 # contributor: Thibaut Cuvelier - Developpez.com
4 # contributor: Thibaut Cuvelier - Developpez.com
5
5
6 fr:
6 fr:
7 direction: ltr
7 direction: ltr
8 date:
8 date:
9 formats:
9 formats:
10 default: "%d/%m/%Y"
10 default: "%d/%m/%Y"
11 short: "%e %b"
11 short: "%e %b"
12 long: "%e %B %Y"
12 long: "%e %B %Y"
13 long_ordinal: "%e %B %Y"
13 long_ordinal: "%e %B %Y"
14 only_day: "%e"
14 only_day: "%e"
15
15
16 day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]
16 day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]
17 abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam]
17 abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam]
18
18
19 # Don't forget the nil at the beginning; there's no such thing as a 0th month
19 # Don't forget the nil at the beginning; there's no such thing as a 0th month
20 month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre]
20 month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre]
21 abbr_month_names: [~, jan., fév., mar., avr., mai, juin, juil., août, sept., oct., nov., déc.]
21 abbr_month_names: [~, jan., fév., mar., avr., mai, juin, juil., août, sept., oct., nov., déc.]
22 # Used in date_select and datime_select.
22 # Used in date_select and datime_select.
23 order:
23 order:
24 - :day
24 - :day
25 - :month
25 - :month
26 - :year
26 - :year
27
27
28 time:
28 time:
29 formats:
29 formats:
30 default: "%d/%m/%Y %H:%M"
30 default: "%d/%m/%Y %H:%M"
31 time: "%H:%M"
31 time: "%H:%M"
32 short: "%d %b %H:%M"
32 short: "%d %b %H:%M"
33 long: "%A %d %B %Y %H:%M:%S %Z"
33 long: "%A %d %B %Y %H:%M:%S %Z"
34 long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
34 long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
35 only_second: "%S"
35 only_second: "%S"
36 am: 'am'
36 am: 'am'
37 pm: 'pm'
37 pm: 'pm'
38
38
39 datetime:
39 datetime:
40 distance_in_words:
40 distance_in_words:
41 half_a_minute: "30 secondes"
41 half_a_minute: "30 secondes"
42 less_than_x_seconds:
42 less_than_x_seconds:
43 zero: "moins d'une seconde"
43 zero: "moins d'une seconde"
44 one: "moins d'une seconde"
44 one: "moins d'une seconde"
45 other: "moins de %{count} secondes"
45 other: "moins de %{count} secondes"
46 x_seconds:
46 x_seconds:
47 one: "1 seconde"
47 one: "1 seconde"
48 other: "%{count} secondes"
48 other: "%{count} secondes"
49 less_than_x_minutes:
49 less_than_x_minutes:
50 zero: "moins d'une minute"
50 zero: "moins d'une minute"
51 one: "moins d'une minute"
51 one: "moins d'une minute"
52 other: "moins de %{count} minutes"
52 other: "moins de %{count} minutes"
53 x_minutes:
53 x_minutes:
54 one: "1 minute"
54 one: "1 minute"
55 other: "%{count} minutes"
55 other: "%{count} minutes"
56 about_x_hours:
56 about_x_hours:
57 one: "environ une heure"
57 one: "environ une heure"
58 other: "environ %{count} heures"
58 other: "environ %{count} heures"
59 x_hours:
59 x_hours:
60 one: "une heure"
60 one: "une heure"
61 other: "%{count} heures"
61 other: "%{count} heures"
62 x_days:
62 x_days:
63 one: "un jour"
63 one: "un jour"
64 other: "%{count} jours"
64 other: "%{count} jours"
65 about_x_months:
65 about_x_months:
66 one: "environ un mois"
66 one: "environ un mois"
67 other: "environ %{count} mois"
67 other: "environ %{count} mois"
68 x_months:
68 x_months:
69 one: "un mois"
69 one: "un mois"
70 other: "%{count} mois"
70 other: "%{count} mois"
71 about_x_years:
71 about_x_years:
72 one: "environ un an"
72 one: "environ un an"
73 other: "environ %{count} ans"
73 other: "environ %{count} ans"
74 over_x_years:
74 over_x_years:
75 one: "plus d'un an"
75 one: "plus d'un an"
76 other: "plus de %{count} ans"
76 other: "plus de %{count} ans"
77 almost_x_years:
77 almost_x_years:
78 one: "presqu'un an"
78 one: "presqu'un an"
79 other: "presque %{count} ans"
79 other: "presque %{count} ans"
80 prompts:
80 prompts:
81 year: "Année"
81 year: "Année"
82 month: "Mois"
82 month: "Mois"
83 day: "Jour"
83 day: "Jour"
84 hour: "Heure"
84 hour: "Heure"
85 minute: "Minute"
85 minute: "Minute"
86 second: "Seconde"
86 second: "Seconde"
87
87
88 number:
88 number:
89 format:
89 format:
90 precision: 3
90 precision: 3
91 separator: ','
91 separator: ','
92 delimiter: ' '
92 delimiter: ' '
93 currency:
93 currency:
94 format:
94 format:
95 unit: '€'
95 unit: '€'
96 precision: 2
96 precision: 2
97 format: '%n %u'
97 format: '%n %u'
98 human:
98 human:
99 format:
99 format:
100 precision: 3
100 precision: 3
101 storage_units:
101 storage_units:
102 format: "%n %u"
102 format: "%n %u"
103 units:
103 units:
104 byte:
104 byte:
105 one: "octet"
105 one: "octet"
106 other: "octets"
106 other: "octets"
107 kb: "ko"
107 kb: "ko"
108 mb: "Mo"
108 mb: "Mo"
109 gb: "Go"
109 gb: "Go"
110 tb: "To"
110 tb: "To"
111
111
112 support:
112 support:
113 array:
113 array:
114 sentence_connector: 'et'
114 sentence_connector: 'et'
115 skip_last_comma: true
115 skip_last_comma: true
116 word_connector: ", "
116 word_connector: ", "
117 two_words_connector: " et "
117 two_words_connector: " et "
118 last_word_connector: " et "
118 last_word_connector: " et "
119
119
120 activerecord:
120 activerecord:
121 errors:
121 errors:
122 template:
122 template:
123 header:
123 header:
124 one: "Impossible d'enregistrer %{model} : une erreur"
124 one: "Impossible d'enregistrer %{model} : une erreur"
125 other: "Impossible d'enregistrer %{model} : %{count} erreurs."
125 other: "Impossible d'enregistrer %{model} : %{count} erreurs."
126 body: "Veuillez vérifier les champs suivants :"
126 body: "Veuillez vérifier les champs suivants :"
127 messages:
127 messages:
128 inclusion: "n'est pas inclus(e) dans la liste"
128 inclusion: "n'est pas inclus(e) dans la liste"
129 exclusion: "n'est pas disponible"
129 exclusion: "n'est pas disponible"
130 invalid: "n'est pas valide"
130 invalid: "n'est pas valide"
131 confirmation: "ne concorde pas avec la confirmation"
131 confirmation: "ne concorde pas avec la confirmation"
132 accepted: "doit être accepté(e)"
132 accepted: "doit être accepté(e)"
133 empty: "doit être renseigné(e)"
133 empty: "doit être renseigné(e)"
134 blank: "doit être renseigné(e)"
134 blank: "doit être renseigné(e)"
135 too_long: "est trop long (pas plus de %{count} caractères)"
135 too_long: "est trop long (pas plus de %{count} caractères)"
136 too_short: "est trop court (au moins %{count} caractères)"
136 too_short: "est trop court (au moins %{count} caractères)"
137 wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
137 wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
138 taken: "est déjà utilisé"
138 taken: "est déjà utilisé"
139 not_a_number: "n'est pas un nombre"
139 not_a_number: "n'est pas un nombre"
140 not_a_date: "n'est pas une date valide"
140 not_a_date: "n'est pas une date valide"
141 greater_than: "doit être supérieur à %{count}"
141 greater_than: "doit être supérieur à %{count}"
142 greater_than_or_equal_to: "doit être supérieur ou égal à %{count}"
142 greater_than_or_equal_to: "doit être supérieur ou égal à %{count}"
143 equal_to: "doit être égal à %{count}"
143 equal_to: "doit être égal à %{count}"
144 less_than: "doit être inférieur à %{count}"
144 less_than: "doit être inférieur à %{count}"
145 less_than_or_equal_to: "doit être inférieur ou égal à %{count}"
145 less_than_or_equal_to: "doit être inférieur ou égal à %{count}"
146 odd: "doit être impair"
146 odd: "doit être impair"
147 even: "doit être pair"
147 even: "doit être pair"
148 greater_than_start_date: "doit être postérieure à la date de début"
148 greater_than_start_date: "doit être postérieure à la date de début"
149 not_same_project: "n'appartient pas au même projet"
149 not_same_project: "n'appartient pas au même projet"
150 circular_dependency: "Cette relation créerait une dépendance circulaire"
150 circular_dependency: "Cette relation créerait une dépendance circulaire"
151 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas être liée à l'une de ses sous-tâches"
151 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas être liée à l'une de ses sous-tâches"
152 earlier_than_minimum_start_date: "ne peut pas être antérieure au %{date} à cause des demandes qui précèdent"
152 earlier_than_minimum_start_date: "ne peut pas être antérieure au %{date} à cause des demandes qui précèdent"
153
153
154 actionview_instancetag_blank_option: Choisir
154 actionview_instancetag_blank_option: Choisir
155
155
156 general_text_No: 'Non'
156 general_text_No: 'Non'
157 general_text_Yes: 'Oui'
157 general_text_Yes: 'Oui'
158 general_text_no: 'non'
158 general_text_no: 'non'
159 general_text_yes: 'oui'
159 general_text_yes: 'oui'
160 general_lang_name: 'Français'
160 general_lang_name: 'Français'
161 general_csv_separator: ';'
161 general_csv_separator: ';'
162 general_csv_decimal_separator: ','
162 general_csv_decimal_separator: ','
163 general_csv_encoding: ISO-8859-1
163 general_csv_encoding: ISO-8859-1
164 general_pdf_fontname: freesans
164 general_pdf_fontname: freesans
165 general_first_day_of_week: '1'
165 general_first_day_of_week: '1'
166
166
167 notice_account_updated: Le compte a été mis à jour avec succès.
167 notice_account_updated: Le compte a été mis à jour avec succès.
168 notice_account_invalid_creditentials: Identifiant ou mot de passe invalide.
168 notice_account_invalid_creditentials: Identifiant ou mot de passe invalide.
169 notice_account_password_updated: Mot de passe mis à jour avec succès.
169 notice_account_password_updated: Mot de passe mis à jour avec succès.
170 notice_account_wrong_password: Mot de passe incorrect
170 notice_account_wrong_password: Mot de passe incorrect
171 notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a été envoyé à l'adresse %{email}.
171 notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a été envoyé à l'adresse %{email}.
172 notice_account_unknown_email: Aucun compte ne correspond à cette adresse.
172 notice_account_unknown_email: Aucun compte ne correspond à cette adresse.
173 notice_account_not_activated_yet: Vous n'avez pas encore activé votre compte. Si vous voulez recevoir un nouveau message d'activation, veuillez <a href="%{url}">cliquer sur ce lien</a>.
173 notice_account_not_activated_yet: Vous n'avez pas encore activé votre compte. Si vous voulez recevoir un nouveau message d'activation, veuillez <a href="%{url}">cliquer sur ce lien</a>.
174 notice_account_locked: Votre compte est verrouillé.
174 notice_account_locked: Votre compte est verrouillé.
175 notice_can_t_change_password: Ce compte utilise une authentification externe. Impossible de changer le mot de passe.
175 notice_can_t_change_password: Ce compte utilise une authentification externe. Impossible de changer le mot de passe.
176 notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a été envoyé.
176 notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a été envoyé.
177 notice_account_activated: Votre compte a été activé. Vous pouvez à présent vous connecter.
177 notice_account_activated: Votre compte a été activé. Vous pouvez à présent vous connecter.
178 notice_successful_create: Création effectuée avec succès.
178 notice_successful_create: Création effectuée avec succès.
179 notice_successful_update: Mise à jour effectuée avec succès.
179 notice_successful_update: Mise à jour effectuée avec succès.
180 notice_successful_delete: Suppression effectuée avec succès.
180 notice_successful_delete: Suppression effectuée avec succès.
181 notice_successful_connection: Connexion réussie.
181 notice_successful_connection: Connexion réussie.
182 notice_file_not_found: "La page à laquelle vous souhaitez accéder n'existe pas ou a été supprimée."
182 notice_file_not_found: "La page à laquelle vous souhaitez accéder n'existe pas ou a été supprimée."
183 notice_locking_conflict: Les données ont été mises à jour par un autre utilisateur. Mise à jour impossible.
183 notice_locking_conflict: Les données ont été mises à jour par un autre utilisateur. Mise à jour impossible.
184 notice_not_authorized: "Vous n'êtes pas autorisé à accéder à cette page."
184 notice_not_authorized: "Vous n'êtes pas autorisé à accéder à cette page."
185 notice_not_authorized_archived_project: Le projet auquel vous tentez d'accéder a été archivé.
185 notice_not_authorized_archived_project: Le projet auquel vous tentez d'accéder a été archivé.
186 notice_email_sent: "Un email a été envoyé à %{value}"
186 notice_email_sent: "Un email a été envoyé à %{value}"
187 notice_email_error: "Erreur lors de l'envoi de l'email (%{value})"
187 notice_email_error: "Erreur lors de l'envoi de l'email (%{value})"
188 notice_feeds_access_key_reseted: "Votre clé d'accès aux flux Atom a été réinitialisée."
188 notice_feeds_access_key_reseted: "Votre clé d'accès aux flux Atom a été réinitialisée."
189 notice_api_access_key_reseted: Votre clé d'accès API a été réinitialisée.
189 notice_api_access_key_reseted: Votre clé d'accès API a été réinitialisée.
190 notice_failed_to_save_issues: "%{count} demande(s) sur les %{total} sélectionnées n'ont pas pu être mise(s) à jour : %{ids}."
190 notice_failed_to_save_issues: "%{count} demande(s) sur les %{total} sélectionnées n'ont pas pu être mise(s) à jour : %{ids}."
191 notice_failed_to_save_time_entries: "%{count} temps passé(s) sur les %{total} sélectionnés n'ont pas pu être mis à jour: %{ids}."
191 notice_failed_to_save_time_entries: "%{count} temps passé(s) sur les %{total} sélectionnés n'ont pas pu être mis à jour: %{ids}."
192 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
192 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
193 notice_no_issue_selected: "Aucune demande sélectionnée ! Cochez les demandes que vous voulez mettre à jour."
193 notice_no_issue_selected: "Aucune demande sélectionnée ! Cochez les demandes que vous voulez mettre à jour."
194 notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur."
194 notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur."
195 notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
195 notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
196 notice_unable_delete_version: Impossible de supprimer cette version.
196 notice_unable_delete_version: Impossible de supprimer cette version.
197 notice_unable_delete_time_entry: Impossible de supprimer le temps passé.
197 notice_unable_delete_time_entry: Impossible de supprimer le temps passé.
198 notice_issue_done_ratios_updated: L'avancement des demandes a été mis à jour.
198 notice_issue_done_ratios_updated: L'avancement des demandes a été mis à jour.
199 notice_gantt_chart_truncated: "Le diagramme a été tronqué car il excède le nombre maximal d'éléments pouvant être affichés (%{max})"
199 notice_gantt_chart_truncated: "Le diagramme a été tronqué car il excède le nombre maximal d'éléments pouvant être affichés (%{max})"
200 notice_issue_successful_create: "Demande %{id} créée."
200 notice_issue_successful_create: "Demande %{id} créée."
201 notice_issue_update_conflict: "La demande a été mise à jour par un autre utilisateur pendant que vous la modifiez."
201 notice_issue_update_conflict: "La demande a été mise à jour par un autre utilisateur pendant que vous la modifiez."
202 notice_account_deleted: "Votre compte a été définitivement supprimé."
202 notice_account_deleted: "Votre compte a été définitivement supprimé."
203 notice_user_successful_create: "Utilisateur %{id} créé."
203 notice_user_successful_create: "Utilisateur %{id} créé."
204 notice_new_password_must_be_different: Votre nouveau mot de passe doit être différent de votre mot de passe actuel
204 notice_new_password_must_be_different: Votre nouveau mot de passe doit être différent de votre mot de passe actuel
205
205
206 error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramétrage : %{value}"
206 error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramétrage : %{value}"
207 error_scm_not_found: "L'entrée et/ou la révision demandée n'existe pas dans le dépôt."
207 error_scm_not_found: "L'entrée et/ou la révision demandée n'existe pas dans le dépôt."
208 error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt : %{value}"
208 error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt : %{value}"
209 error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée."
209 error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée."
210 error_scm_annotate_big_text_file: Cette entrée ne peut pas être annotée car elle excède la taille maximale.
210 error_scm_annotate_big_text_file: Cette entrée ne peut pas être annotée car elle excède la taille maximale.
211 error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet"
211 error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet"
212 error_no_tracker_in_project: "Aucun tracker n'est associé à ce projet. Vérifier la configuration du projet."
212 error_no_tracker_in_project: "Aucun tracker n'est associé à ce projet. Vérifier la configuration du projet."
213 error_no_default_issue_status: "Aucun statut de demande n'est défini par défaut. Vérifier votre configuration (Administration -> Statuts de demandes)."
213 error_no_default_issue_status: "Aucun statut de demande n'est défini par défaut. Vérifier votre configuration (Administration -> Statuts de demandes)."
214 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisé
214 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisé
215 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas être supprimé.
215 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas être supprimé.
216 error_can_not_remove_role: Ce rôle est utilisé et ne peut pas être supprimé.
216 error_can_not_remove_role: Ce rôle est utilisé et ne peut pas être supprimé.
217 error_can_not_reopen_issue_on_closed_version: 'Une demande assignée à une version fermée ne peut pas être réouverte'
217 error_can_not_reopen_issue_on_closed_version: 'Une demande assignée à une version fermée ne peut pas être réouverte'
218 error_can_not_archive_project: "Ce projet ne peut pas être archivé"
218 error_can_not_archive_project: "Ce projet ne peut pas être archivé"
219 error_issue_done_ratios_not_updated: L'avancement des demandes n'a pas pu être mis à jour.
219 error_issue_done_ratios_not_updated: L'avancement des demandes n'a pas pu être mis à jour.
220 error_workflow_copy_source: 'Veuillez sélectionner un tracker et/ou un rôle source'
220 error_workflow_copy_source: 'Veuillez sélectionner un tracker et/ou un rôle source'
221 error_workflow_copy_target: 'Veuillez sélectionner les trackers et rôles cibles'
221 error_workflow_copy_target: 'Veuillez sélectionner les trackers et rôles cibles'
222 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
222 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
223 error_unable_to_connect: Connexion impossible (%{value})
223 error_unable_to_connect: Connexion impossible (%{value})
224 error_attachment_too_big: Ce fichier ne peut pas être attaché car il excède la taille maximale autorisée (%{max_size})
224 error_attachment_too_big: Ce fichier ne peut pas être attaché car il excède la taille maximale autorisée (%{max_size})
225 error_session_expired: "Votre session a expiré. Veuillez vous reconnecter."
225 error_session_expired: "Votre session a expiré. Veuillez vous reconnecter."
226 warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu être sauvegardés."
226 warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu être sauvegardés."
227
227
228 mail_subject_lost_password: "Votre mot de passe %{value}"
228 mail_subject_lost_password: "Votre mot de passe %{value}"
229 mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
229 mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
230 mail_subject_register: "Activation de votre compte %{value}"
230 mail_subject_register: "Activation de votre compte %{value}"
231 mail_body_register: 'Pour activer votre compte, cliquez sur le lien suivant :'
231 mail_body_register: 'Pour activer votre compte, cliquez sur le lien suivant :'
232 mail_body_account_information_external: "Vous pouvez utiliser votre compte %{value} pour vous connecter."
232 mail_body_account_information_external: "Vous pouvez utiliser votre compte %{value} pour vous connecter."
233 mail_body_account_information: Paramètres de connexion de votre compte
233 mail_body_account_information: Paramètres de connexion de votre compte
234 mail_subject_account_activation_request: "Demande d'activation d'un compte %{value}"
234 mail_subject_account_activation_request: "Demande d'activation d'un compte %{value}"
235 mail_body_account_activation_request: "Un nouvel utilisateur (%{value}) s'est inscrit. Son compte nécessite votre approbation :"
235 mail_body_account_activation_request: "Un nouvel utilisateur (%{value}) s'est inscrit. Son compte nécessite votre approbation :"
236 mail_subject_reminder: "%{count} demande(s) arrivent à échéance (%{days})"
236 mail_subject_reminder: "%{count} demande(s) arrivent à échéance (%{days})"
237 mail_body_reminder: "%{count} demande(s) qui vous sont assignées arrivent à échéance dans les %{days} prochains jours :"
237 mail_body_reminder: "%{count} demande(s) qui vous sont assignées arrivent à échéance dans les %{days} prochains jours :"
238 mail_subject_wiki_content_added: "Page wiki '%{id}' ajoutée"
238 mail_subject_wiki_content_added: "Page wiki '%{id}' ajoutée"
239 mail_body_wiki_content_added: "La page wiki '%{id}' a été ajoutée par %{author}."
239 mail_body_wiki_content_added: "La page wiki '%{id}' a été ajoutée par %{author}."
240 mail_subject_wiki_content_updated: "Page wiki '%{id}' mise à jour"
240 mail_subject_wiki_content_updated: "Page wiki '%{id}' mise à jour"
241 mail_body_wiki_content_updated: "La page wiki '%{id}' a été mise à jour par %{author}."
241 mail_body_wiki_content_updated: "La page wiki '%{id}' a été mise à jour par %{author}."
242
242
243 field_name: Nom
243 field_name: Nom
244 field_description: Description
244 field_description: Description
245 field_summary: Résumé
245 field_summary: Résumé
246 field_is_required: Obligatoire
246 field_is_required: Obligatoire
247 field_firstname: Prénom
247 field_firstname: Prénom
248 field_lastname: Nom
248 field_lastname: Nom
249 field_mail: Email
249 field_mail: Email
250 field_filename: Fichier
250 field_filename: Fichier
251 field_filesize: Taille
251 field_filesize: Taille
252 field_downloads: Téléchargements
252 field_downloads: Téléchargements
253 field_author: Auteur
253 field_author: Auteur
254 field_created_on: Créé
254 field_created_on: Créé
255 field_updated_on: Mis-à-jour
255 field_updated_on: Mis-à-jour
256 field_closed_on: Fermé
256 field_closed_on: Fermé
257 field_field_format: Format
257 field_field_format: Format
258 field_is_for_all: Pour tous les projets
258 field_is_for_all: Pour tous les projets
259 field_possible_values: Valeurs possibles
259 field_possible_values: Valeurs possibles
260 field_regexp: Expression régulière
260 field_regexp: Expression régulière
261 field_min_length: Longueur minimum
261 field_min_length: Longueur minimum
262 field_max_length: Longueur maximum
262 field_max_length: Longueur maximum
263 field_value: Valeur
263 field_value: Valeur
264 field_category: Catégorie
264 field_category: Catégorie
265 field_title: Titre
265 field_title: Titre
266 field_project: Projet
266 field_project: Projet
267 field_issue: Demande
267 field_issue: Demande
268 field_status: Statut
268 field_status: Statut
269 field_notes: Notes
269 field_notes: Notes
270 field_is_closed: Demande fermée
270 field_is_closed: Demande fermée
271 field_is_default: Valeur par défaut
271 field_is_default: Valeur par défaut
272 field_tracker: Tracker
272 field_tracker: Tracker
273 field_subject: Sujet
273 field_subject: Sujet
274 field_due_date: Echéance
274 field_due_date: Echéance
275 field_assigned_to: Assigné à
275 field_assigned_to: Assigné à
276 field_priority: Priorité
276 field_priority: Priorité
277 field_fixed_version: Version cible
277 field_fixed_version: Version cible
278 field_user: Utilisateur
278 field_user: Utilisateur
279 field_principal: Principal
279 field_principal: Principal
280 field_role: Rôle
280 field_role: Rôle
281 field_homepage: Site web
281 field_homepage: Site web
282 field_is_public: Public
282 field_is_public: Public
283 field_parent: Sous-projet de
283 field_parent: Sous-projet de
284 field_is_in_roadmap: Demandes affichées dans la roadmap
284 field_is_in_roadmap: Demandes affichées dans la roadmap
285 field_login: Identifiant
285 field_login: Identifiant
286 field_mail_notification: Notifications par mail
286 field_mail_notification: Notifications par mail
287 field_admin: Administrateur
287 field_admin: Administrateur
288 field_last_login_on: Dernière connexion
288 field_last_login_on: Dernière connexion
289 field_language: Langue
289 field_language: Langue
290 field_effective_date: Date
290 field_effective_date: Date
291 field_password: Mot de passe
291 field_password: Mot de passe
292 field_new_password: Nouveau mot de passe
292 field_new_password: Nouveau mot de passe
293 field_password_confirmation: Confirmation
293 field_password_confirmation: Confirmation
294 field_version: Version
294 field_version: Version
295 field_type: Type
295 field_type: Type
296 field_host: Hôte
296 field_host: Hôte
297 field_port: Port
297 field_port: Port
298 field_account: Compte
298 field_account: Compte
299 field_base_dn: Base DN
299 field_base_dn: Base DN
300 field_attr_login: Attribut Identifiant
300 field_attr_login: Attribut Identifiant
301 field_attr_firstname: Attribut Prénom
301 field_attr_firstname: Attribut Prénom
302 field_attr_lastname: Attribut Nom
302 field_attr_lastname: Attribut Nom
303 field_attr_mail: Attribut Email
303 field_attr_mail: Attribut Email
304 field_onthefly: Création des utilisateurs à la volée
304 field_onthefly: Création des utilisateurs à la volée
305 field_start_date: Début
305 field_start_date: Début
306 field_done_ratio: "% réalisé"
306 field_done_ratio: "% réalisé"
307 field_auth_source: Mode d'authentification
307 field_auth_source: Mode d'authentification
308 field_hide_mail: Cacher mon adresse mail
308 field_hide_mail: Cacher mon adresse mail
309 field_comments: Commentaire
309 field_comments: Commentaire
310 field_url: URL
310 field_url: URL
311 field_start_page: Page de démarrage
311 field_start_page: Page de démarrage
312 field_subproject: Sous-projet
312 field_subproject: Sous-projet
313 field_hours: Heures
313 field_hours: Heures
314 field_activity: Activité
314 field_activity: Activité
315 field_spent_on: Date
315 field_spent_on: Date
316 field_identifier: Identifiant
316 field_identifier: Identifiant
317 field_is_filter: Utilisé comme filtre
317 field_is_filter: Utilisé comme filtre
318 field_issue_to: Demande liée
318 field_issue_to: Demande liée
319 field_delay: Retard
319 field_delay: Retard
320 field_assignable: Demandes assignables à ce rôle
320 field_assignable: Demandes assignables à ce rôle
321 field_redirect_existing_links: Rediriger les liens existants
321 field_redirect_existing_links: Rediriger les liens existants
322 field_estimated_hours: Temps estimé
322 field_estimated_hours: Temps estimé
323 field_column_names: Colonnes
323 field_column_names: Colonnes
324 field_time_entries: Temps passé
324 field_time_entries: Temps passé
325 field_time_zone: Fuseau horaire
325 field_time_zone: Fuseau horaire
326 field_searchable: Utilisé pour les recherches
326 field_searchable: Utilisé pour les recherches
327 field_default_value: Valeur par défaut
327 field_default_value: Valeur par défaut
328 field_comments_sorting: Afficher les commentaires
328 field_comments_sorting: Afficher les commentaires
329 field_parent_title: Page parent
329 field_parent_title: Page parent
330 field_editable: Modifiable
330 field_editable: Modifiable
331 field_watcher: Observateur
331 field_watcher: Observateur
332 field_identity_url: URL OpenID
332 field_identity_url: URL OpenID
333 field_content: Contenu
333 field_content: Contenu
334 field_group_by: Grouper par
334 field_group_by: Grouper par
335 field_sharing: Partage
335 field_sharing: Partage
336 field_parent_issue: Tâche parente
336 field_parent_issue: Tâche parente
337 field_member_of_group: Groupe de l'assigné
337 field_member_of_group: Groupe de l'assigné
338 field_assigned_to_role: Rôle de l'assigné
338 field_assigned_to_role: Rôle de l'assigné
339 field_text: Champ texte
339 field_text: Champ texte
340 field_visible: Visible
340 field_visible: Visible
341 field_warn_on_leaving_unsaved: "M'avertir lorsque je quitte une page contenant du texte non sauvegardé"
341 field_warn_on_leaving_unsaved: "M'avertir lorsque je quitte une page contenant du texte non sauvegardé"
342 field_issues_visibility: Visibilité des demandes
342 field_issues_visibility: Visibilité des demandes
343 field_is_private: Privée
343 field_is_private: Privée
344 field_commit_logs_encoding: Encodage des messages de commit
344 field_commit_logs_encoding: Encodage des messages de commit
345 field_scm_path_encoding: Encodage des chemins
345 field_scm_path_encoding: Encodage des chemins
346 field_path_to_repository: Chemin du dépôt
346 field_path_to_repository: Chemin du dépôt
347 field_root_directory: Répertoire racine
347 field_root_directory: Répertoire racine
348 field_cvsroot: CVSROOT
348 field_cvsroot: CVSROOT
349 field_cvs_module: Module
349 field_cvs_module: Module
350 field_repository_is_default: Dépôt principal
350 field_repository_is_default: Dépôt principal
351 field_multiple: Valeurs multiples
351 field_multiple: Valeurs multiples
352 field_auth_source_ldap_filter: Filtre LDAP
352 field_auth_source_ldap_filter: Filtre LDAP
353 field_core_fields: Champs standards
353 field_core_fields: Champs standards
354 field_timeout: "Timeout (en secondes)"
354 field_timeout: "Timeout (en secondes)"
355 field_board_parent: Forum parent
355 field_board_parent: Forum parent
356 field_private_notes: Notes privées
356 field_private_notes: Notes privées
357 field_inherit_members: Hériter les membres
357 field_inherit_members: Hériter les membres
358 field_generate_password: Générer un mot de passe
358 field_generate_password: Générer un mot de passe
359 field_must_change_passwd: Doit changer de mot de passe à la prochaine connexion
359 field_must_change_passwd: Doit changer de mot de passe à la prochaine connexion
360 field_default_status: Statut par défaut
360
361
361 setting_app_title: Titre de l'application
362 setting_app_title: Titre de l'application
362 setting_app_subtitle: Sous-titre de l'application
363 setting_app_subtitle: Sous-titre de l'application
363 setting_welcome_text: Texte d'accueil
364 setting_welcome_text: Texte d'accueil
364 setting_default_language: Langue par défaut
365 setting_default_language: Langue par défaut
365 setting_login_required: Authentification obligatoire
366 setting_login_required: Authentification obligatoire
366 setting_self_registration: Inscription des nouveaux utilisateurs
367 setting_self_registration: Inscription des nouveaux utilisateurs
367 setting_attachment_max_size: Taille maximale des fichiers
368 setting_attachment_max_size: Taille maximale des fichiers
368 setting_issues_export_limit: Limite d'exportation des demandes
369 setting_issues_export_limit: Limite d'exportation des demandes
369 setting_mail_from: Adresse d'émission
370 setting_mail_from: Adresse d'émission
370 setting_bcc_recipients: Destinataires en copie cachée (cci)
371 setting_bcc_recipients: Destinataires en copie cachée (cci)
371 setting_plain_text_mail: Mail en texte brut (non HTML)
372 setting_plain_text_mail: Mail en texte brut (non HTML)
372 setting_host_name: Nom d'hôte et chemin
373 setting_host_name: Nom d'hôte et chemin
373 setting_text_formatting: Formatage du texte
374 setting_text_formatting: Formatage du texte
374 setting_wiki_compression: Compression de l'historique des pages wiki
375 setting_wiki_compression: Compression de l'historique des pages wiki
375 setting_feeds_limit: Nombre maximal d'éléments dans les flux Atom
376 setting_feeds_limit: Nombre maximal d'éléments dans les flux Atom
376 setting_default_projects_public: Définir les nouveaux projets comme publics par défaut
377 setting_default_projects_public: Définir les nouveaux projets comme publics par défaut
377 setting_autofetch_changesets: Récupération automatique des commits
378 setting_autofetch_changesets: Récupération automatique des commits
378 setting_sys_api_enabled: Activer les WS pour la gestion des dépôts
379 setting_sys_api_enabled: Activer les WS pour la gestion des dépôts
379 setting_commit_ref_keywords: Mots-clés de référencement
380 setting_commit_ref_keywords: Mots-clés de référencement
380 setting_commit_fix_keywords: Mots-clés de résolution
381 setting_commit_fix_keywords: Mots-clés de résolution
381 setting_autologin: Durée maximale de connexion automatique
382 setting_autologin: Durée maximale de connexion automatique
382 setting_date_format: Format de date
383 setting_date_format: Format de date
383 setting_time_format: Format d'heure
384 setting_time_format: Format d'heure
384 setting_cross_project_issue_relations: Autoriser les relations entre demandes de différents projets
385 setting_cross_project_issue_relations: Autoriser les relations entre demandes de différents projets
385 setting_cross_project_subtasks: Autoriser les sous-tâches dans des projets différents
386 setting_cross_project_subtasks: Autoriser les sous-tâches dans des projets différents
386 setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
387 setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
387 setting_repositories_encodings: Encodages des fichiers et des dépôts
388 setting_repositories_encodings: Encodages des fichiers et des dépôts
388 setting_emails_header: En-tête des emails
389 setting_emails_header: En-tête des emails
389 setting_emails_footer: Pied-de-page des emails
390 setting_emails_footer: Pied-de-page des emails
390 setting_protocol: Protocole
391 setting_protocol: Protocole
391 setting_per_page_options: Options d'objets affichés par page
392 setting_per_page_options: Options d'objets affichés par page
392 setting_user_format: Format d'affichage des utilisateurs
393 setting_user_format: Format d'affichage des utilisateurs
393 setting_activity_days_default: Nombre de jours affichés sur l'activité des projets
394 setting_activity_days_default: Nombre de jours affichés sur l'activité des projets
394 setting_display_subprojects_issues: Afficher par défaut les demandes des sous-projets sur les projets principaux
395 setting_display_subprojects_issues: Afficher par défaut les demandes des sous-projets sur les projets principaux
395 setting_enabled_scm: SCM activés
396 setting_enabled_scm: SCM activés
396 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
397 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
397 setting_mail_handler_api_enabled: "Activer le WS pour la réception d'emails"
398 setting_mail_handler_api_enabled: "Activer le WS pour la réception d'emails"
398 setting_mail_handler_api_key: Clé de protection de l'API
399 setting_mail_handler_api_key: Clé de protection de l'API
399 setting_sequential_project_identifiers: Générer des identifiants de projet séquentiels
400 setting_sequential_project_identifiers: Générer des identifiants de projet séquentiels
400 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
401 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
401 setting_gravatar_default: Image Gravatar par défaut
402 setting_gravatar_default: Image Gravatar par défaut
402 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichées
403 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichées
403 setting_file_max_size_displayed: Taille maximum des fichiers texte affichés en ligne
404 setting_file_max_size_displayed: Taille maximum des fichiers texte affichés en ligne
404 setting_repository_log_display_limit: "Nombre maximum de révisions affichées sur l'historique d'un fichier"
405 setting_repository_log_display_limit: "Nombre maximum de révisions affichées sur l'historique d'un fichier"
405 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
406 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
406 setting_password_min_length: Longueur minimum des mots de passe
407 setting_password_min_length: Longueur minimum des mots de passe
407 setting_new_project_user_role_id: Rôle donné à un utilisateur non-administrateur qui crée un projet
408 setting_new_project_user_role_id: Rôle donné à un utilisateur non-administrateur qui crée un projet
408 setting_default_projects_modules: Modules activés par défaut pour les nouveaux projets
409 setting_default_projects_modules: Modules activés par défaut pour les nouveaux projets
409 setting_issue_done_ratio: Calcul de l'avancement des demandes
410 setting_issue_done_ratio: Calcul de l'avancement des demandes
410 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectué'
411 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectué'
411 setting_issue_done_ratio_issue_status: Utiliser le statut
412 setting_issue_done_ratio_issue_status: Utiliser le statut
412 setting_start_of_week: Jour de début des calendriers
413 setting_start_of_week: Jour de début des calendriers
413 setting_rest_api_enabled: Activer l'API REST
414 setting_rest_api_enabled: Activer l'API REST
414 setting_cache_formatted_text: Mettre en cache le texte formaté
415 setting_cache_formatted_text: Mettre en cache le texte formaté
415 setting_default_notification_option: Option de notification par défaut
416 setting_default_notification_option: Option de notification par défaut
416 setting_commit_logtime_enabled: Permettre la saisie de temps
417 setting_commit_logtime_enabled: Permettre la saisie de temps
417 setting_commit_logtime_activity_id: Activité pour le temps saisi
418 setting_commit_logtime_activity_id: Activité pour le temps saisi
418 setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
419 setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
419 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
420 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
420 setting_default_issue_start_date_to_creation_date: Donner à la date de début d'une nouvelle demande la valeur de la date du jour
421 setting_default_issue_start_date_to_creation_date: Donner à la date de début d'une nouvelle demande la valeur de la date du jour
421 setting_commit_cross_project_ref: Permettre le référencement et la résolution des demandes de tous les autres projets
422 setting_commit_cross_project_ref: Permettre le référencement et la résolution des demandes de tous les autres projets
422 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
423 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
423 setting_session_lifetime: Durée de vie maximale des sessions
424 setting_session_lifetime: Durée de vie maximale des sessions
424 setting_session_timeout: Durée maximale d'inactivité
425 setting_session_timeout: Durée maximale d'inactivité
425 setting_thumbnails_enabled: Afficher les vignettes des images
426 setting_thumbnails_enabled: Afficher les vignettes des images
426 setting_thumbnails_size: Taille des vignettes (en pixels)
427 setting_thumbnails_size: Taille des vignettes (en pixels)
427 setting_non_working_week_days: Jours non travaillés
428 setting_non_working_week_days: Jours non travaillés
428 setting_jsonp_enabled: Activer le support JSONP
429 setting_jsonp_enabled: Activer le support JSONP
429 setting_default_projects_tracker_ids: Trackers par défaut pour les nouveaux projets
430 setting_default_projects_tracker_ids: Trackers par défaut pour les nouveaux projets
430 setting_mail_handler_excluded_filenames: Exclure les fichiers attachés par leur nom
431 setting_mail_handler_excluded_filenames: Exclure les fichiers attachés par leur nom
431 setting_force_default_language_for_anonymous: Forcer la langue par défault pour les utilisateurs anonymes
432 setting_force_default_language_for_anonymous: Forcer la langue par défault pour les utilisateurs anonymes
432 setting_force_default_language_for_loggedin: Forcer la langue par défault pour les utilisateurs identifiés
433 setting_force_default_language_for_loggedin: Forcer la langue par défault pour les utilisateurs identifiés
433
434
434 permission_add_project: Créer un projet
435 permission_add_project: Créer un projet
435 permission_add_subprojects: Créer des sous-projets
436 permission_add_subprojects: Créer des sous-projets
436 permission_edit_project: Modifier le projet
437 permission_edit_project: Modifier le projet
437 permission_close_project: Fermer / réouvrir le projet
438 permission_close_project: Fermer / réouvrir le projet
438 permission_select_project_modules: Choisir les modules
439 permission_select_project_modules: Choisir les modules
439 permission_manage_members: Gérer les membres
440 permission_manage_members: Gérer les membres
440 permission_manage_project_activities: Gérer les activités
441 permission_manage_project_activities: Gérer les activités
441 permission_manage_versions: Gérer les versions
442 permission_manage_versions: Gérer les versions
442 permission_manage_categories: Gérer les catégories de demandes
443 permission_manage_categories: Gérer les catégories de demandes
443 permission_view_issues: Voir les demandes
444 permission_view_issues: Voir les demandes
444 permission_add_issues: Créer des demandes
445 permission_add_issues: Créer des demandes
445 permission_edit_issues: Modifier les demandes
446 permission_edit_issues: Modifier les demandes
446 permission_manage_issue_relations: Gérer les relations
447 permission_manage_issue_relations: Gérer les relations
447 permission_set_issues_private: Rendre les demandes publiques ou privées
448 permission_set_issues_private: Rendre les demandes publiques ou privées
448 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privées
449 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privées
449 permission_add_issue_notes: Ajouter des notes
450 permission_add_issue_notes: Ajouter des notes
450 permission_edit_issue_notes: Modifier les notes
451 permission_edit_issue_notes: Modifier les notes
451 permission_edit_own_issue_notes: Modifier ses propres notes
452 permission_edit_own_issue_notes: Modifier ses propres notes
452 permission_view_private_notes: Voir les notes privées
453 permission_view_private_notes: Voir les notes privées
453 permission_set_notes_private: Rendre les notes privées
454 permission_set_notes_private: Rendre les notes privées
454 permission_move_issues: Déplacer les demandes
455 permission_move_issues: Déplacer les demandes
455 permission_delete_issues: Supprimer les demandes
456 permission_delete_issues: Supprimer les demandes
456 permission_manage_public_queries: Gérer les requêtes publiques
457 permission_manage_public_queries: Gérer les requêtes publiques
457 permission_save_queries: Sauvegarder les requêtes
458 permission_save_queries: Sauvegarder les requêtes
458 permission_view_gantt: Voir le gantt
459 permission_view_gantt: Voir le gantt
459 permission_view_calendar: Voir le calendrier
460 permission_view_calendar: Voir le calendrier
460 permission_view_issue_watchers: Voir la liste des observateurs
461 permission_view_issue_watchers: Voir la liste des observateurs
461 permission_add_issue_watchers: Ajouter des observateurs
462 permission_add_issue_watchers: Ajouter des observateurs
462 permission_delete_issue_watchers: Supprimer des observateurs
463 permission_delete_issue_watchers: Supprimer des observateurs
463 permission_log_time: Saisir le temps passé
464 permission_log_time: Saisir le temps passé
464 permission_view_time_entries: Voir le temps passé
465 permission_view_time_entries: Voir le temps passé
465 permission_edit_time_entries: Modifier les temps passés
466 permission_edit_time_entries: Modifier les temps passés
466 permission_edit_own_time_entries: Modifier son propre temps passé
467 permission_edit_own_time_entries: Modifier son propre temps passé
467 permission_manage_news: Gérer les annonces
468 permission_manage_news: Gérer les annonces
468 permission_comment_news: Commenter les annonces
469 permission_comment_news: Commenter les annonces
469 permission_view_documents: Voir les documents
470 permission_view_documents: Voir les documents
470 permission_add_documents: Ajouter des documents
471 permission_add_documents: Ajouter des documents
471 permission_edit_documents: Modifier les documents
472 permission_edit_documents: Modifier les documents
472 permission_delete_documents: Supprimer les documents
473 permission_delete_documents: Supprimer les documents
473 permission_manage_files: Gérer les fichiers
474 permission_manage_files: Gérer les fichiers
474 permission_view_files: Voir les fichiers
475 permission_view_files: Voir les fichiers
475 permission_manage_wiki: Gérer le wiki
476 permission_manage_wiki: Gérer le wiki
476 permission_rename_wiki_pages: Renommer les pages
477 permission_rename_wiki_pages: Renommer les pages
477 permission_delete_wiki_pages: Supprimer les pages
478 permission_delete_wiki_pages: Supprimer les pages
478 permission_view_wiki_pages: Voir le wiki
479 permission_view_wiki_pages: Voir le wiki
479 permission_view_wiki_edits: "Voir l'historique des modifications"
480 permission_view_wiki_edits: "Voir l'historique des modifications"
480 permission_edit_wiki_pages: Modifier les pages
481 permission_edit_wiki_pages: Modifier les pages
481 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
482 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
482 permission_protect_wiki_pages: Protéger les pages
483 permission_protect_wiki_pages: Protéger les pages
483 permission_manage_repository: Gérer le dépôt de sources
484 permission_manage_repository: Gérer le dépôt de sources
484 permission_browse_repository: Parcourir les sources
485 permission_browse_repository: Parcourir les sources
485 permission_view_changesets: Voir les révisions
486 permission_view_changesets: Voir les révisions
486 permission_commit_access: Droit de commit
487 permission_commit_access: Droit de commit
487 permission_manage_boards: Gérer les forums
488 permission_manage_boards: Gérer les forums
488 permission_view_messages: Voir les messages
489 permission_view_messages: Voir les messages
489 permission_add_messages: Poster un message
490 permission_add_messages: Poster un message
490 permission_edit_messages: Modifier les messages
491 permission_edit_messages: Modifier les messages
491 permission_edit_own_messages: Modifier ses propres messages
492 permission_edit_own_messages: Modifier ses propres messages
492 permission_delete_messages: Supprimer les messages
493 permission_delete_messages: Supprimer les messages
493 permission_delete_own_messages: Supprimer ses propres messages
494 permission_delete_own_messages: Supprimer ses propres messages
494 permission_export_wiki_pages: Exporter les pages
495 permission_export_wiki_pages: Exporter les pages
495 permission_manage_subtasks: Gérer les sous-tâches
496 permission_manage_subtasks: Gérer les sous-tâches
496 permission_manage_related_issues: Gérer les demandes associées
497 permission_manage_related_issues: Gérer les demandes associées
497
498
498 project_module_issue_tracking: Suivi des demandes
499 project_module_issue_tracking: Suivi des demandes
499 project_module_time_tracking: Suivi du temps passé
500 project_module_time_tracking: Suivi du temps passé
500 project_module_news: Publication d'annonces
501 project_module_news: Publication d'annonces
501 project_module_documents: Publication de documents
502 project_module_documents: Publication de documents
502 project_module_files: Publication de fichiers
503 project_module_files: Publication de fichiers
503 project_module_wiki: Wiki
504 project_module_wiki: Wiki
504 project_module_repository: Dépôt de sources
505 project_module_repository: Dépôt de sources
505 project_module_boards: Forums de discussion
506 project_module_boards: Forums de discussion
506 project_module_calendar: Calendrier
507 project_module_calendar: Calendrier
507 project_module_gantt: Gantt
508 project_module_gantt: Gantt
508
509
509 label_user: Utilisateur
510 label_user: Utilisateur
510 label_user_plural: Utilisateurs
511 label_user_plural: Utilisateurs
511 label_user_new: Nouvel utilisateur
512 label_user_new: Nouvel utilisateur
512 label_user_anonymous: Anonyme
513 label_user_anonymous: Anonyme
513 label_project: Projet
514 label_project: Projet
514 label_project_new: Nouveau projet
515 label_project_new: Nouveau projet
515 label_project_plural: Projets
516 label_project_plural: Projets
516 label_x_projects:
517 label_x_projects:
517 zero: aucun projet
518 zero: aucun projet
518 one: un projet
519 one: un projet
519 other: "%{count} projets"
520 other: "%{count} projets"
520 label_project_all: Tous les projets
521 label_project_all: Tous les projets
521 label_project_latest: Derniers projets
522 label_project_latest: Derniers projets
522 label_issue: Demande
523 label_issue: Demande
523 label_issue_new: Nouvelle demande
524 label_issue_new: Nouvelle demande
524 label_issue_plural: Demandes
525 label_issue_plural: Demandes
525 label_issue_view_all: Voir toutes les demandes
526 label_issue_view_all: Voir toutes les demandes
526 label_issues_by: "Demandes par %{value}"
527 label_issues_by: "Demandes par %{value}"
527 label_issue_added: Demande ajoutée
528 label_issue_added: Demande ajoutée
528 label_issue_updated: Demande mise à jour
529 label_issue_updated: Demande mise à jour
529 label_issue_note_added: Note ajoutée
530 label_issue_note_added: Note ajoutée
530 label_issue_status_updated: Statut changé
531 label_issue_status_updated: Statut changé
531 label_issue_assigned_to_updated: Assigné changé
532 label_issue_assigned_to_updated: Assigné changé
532 label_issue_priority_updated: Priorité changée
533 label_issue_priority_updated: Priorité changée
533 label_document: Document
534 label_document: Document
534 label_document_new: Nouveau document
535 label_document_new: Nouveau document
535 label_document_plural: Documents
536 label_document_plural: Documents
536 label_document_added: Document ajouté
537 label_document_added: Document ajouté
537 label_role: Rôle
538 label_role: Rôle
538 label_role_plural: Rôles
539 label_role_plural: Rôles
539 label_role_new: Nouveau rôle
540 label_role_new: Nouveau rôle
540 label_role_and_permissions: Rôles et permissions
541 label_role_and_permissions: Rôles et permissions
541 label_role_anonymous: Anonyme
542 label_role_anonymous: Anonyme
542 label_role_non_member: Non membre
543 label_role_non_member: Non membre
543 label_member: Membre
544 label_member: Membre
544 label_member_new: Nouveau membre
545 label_member_new: Nouveau membre
545 label_member_plural: Membres
546 label_member_plural: Membres
546 label_tracker: Tracker
547 label_tracker: Tracker
547 label_tracker_plural: Trackers
548 label_tracker_plural: Trackers
548 label_tracker_new: Nouveau tracker
549 label_tracker_new: Nouveau tracker
549 label_workflow: Workflow
550 label_workflow: Workflow
550 label_issue_status: Statut de demandes
551 label_issue_status: Statut de demandes
551 label_issue_status_plural: Statuts de demandes
552 label_issue_status_plural: Statuts de demandes
552 label_issue_status_new: Nouveau statut
553 label_issue_status_new: Nouveau statut
553 label_issue_category: Catégorie de demandes
554 label_issue_category: Catégorie de demandes
554 label_issue_category_plural: Catégories de demandes
555 label_issue_category_plural: Catégories de demandes
555 label_issue_category_new: Nouvelle catégorie
556 label_issue_category_new: Nouvelle catégorie
556 label_custom_field: Champ personnalisé
557 label_custom_field: Champ personnalisé
557 label_custom_field_plural: Champs personnalisés
558 label_custom_field_plural: Champs personnalisés
558 label_custom_field_new: Nouveau champ personnalisé
559 label_custom_field_new: Nouveau champ personnalisé
559 label_enumerations: Listes de valeurs
560 label_enumerations: Listes de valeurs
560 label_enumeration_new: Nouvelle valeur
561 label_enumeration_new: Nouvelle valeur
561 label_information: Information
562 label_information: Information
562 label_information_plural: Informations
563 label_information_plural: Informations
563 label_please_login: Identification
564 label_please_login: Identification
564 label_register: S'enregistrer
565 label_register: S'enregistrer
565 label_login_with_open_id_option: S'authentifier avec OpenID
566 label_login_with_open_id_option: S'authentifier avec OpenID
566 label_password_lost: Mot de passe perdu
567 label_password_lost: Mot de passe perdu
567 label_home: Accueil
568 label_home: Accueil
568 label_my_page: Ma page
569 label_my_page: Ma page
569 label_my_account: Mon compte
570 label_my_account: Mon compte
570 label_my_projects: Mes projets
571 label_my_projects: Mes projets
571 label_my_page_block: Blocs disponibles
572 label_my_page_block: Blocs disponibles
572 label_administration: Administration
573 label_administration: Administration
573 label_login: Connexion
574 label_login: Connexion
574 label_logout: Déconnexion
575 label_logout: Déconnexion
575 label_help: Aide
576 label_help: Aide
576 label_reported_issues: Demandes soumises
577 label_reported_issues: Demandes soumises
577 label_assigned_to_me_issues: Demandes qui me sont assignées
578 label_assigned_to_me_issues: Demandes qui me sont assignées
578 label_last_login: Dernière connexion
579 label_last_login: Dernière connexion
579 label_registered_on: Inscrit le
580 label_registered_on: Inscrit le
580 label_activity: Activité
581 label_activity: Activité
581 label_overall_activity: Activité globale
582 label_overall_activity: Activité globale
582 label_user_activity: "Activité de %{value}"
583 label_user_activity: "Activité de %{value}"
583 label_new: Nouveau
584 label_new: Nouveau
584 label_logged_as: Connecté en tant que
585 label_logged_as: Connecté en tant que
585 label_environment: Environnement
586 label_environment: Environnement
586 label_authentication: Authentification
587 label_authentication: Authentification
587 label_auth_source: Mode d'authentification
588 label_auth_source: Mode d'authentification
588 label_auth_source_new: Nouveau mode d'authentification
589 label_auth_source_new: Nouveau mode d'authentification
589 label_auth_source_plural: Modes d'authentification
590 label_auth_source_plural: Modes d'authentification
590 label_subproject_plural: Sous-projets
591 label_subproject_plural: Sous-projets
591 label_subproject_new: Nouveau sous-projet
592 label_subproject_new: Nouveau sous-projet
592 label_and_its_subprojects: "%{value} et ses sous-projets"
593 label_and_its_subprojects: "%{value} et ses sous-projets"
593 label_min_max_length: Longueurs mini - maxi
594 label_min_max_length: Longueurs mini - maxi
594 label_list: Liste
595 label_list: Liste
595 label_date: Date
596 label_date: Date
596 label_integer: Entier
597 label_integer: Entier
597 label_float: Nombre décimal
598 label_float: Nombre décimal
598 label_boolean: Booléen
599 label_boolean: Booléen
599 label_string: Texte
600 label_string: Texte
600 label_text: Texte long
601 label_text: Texte long
601 label_attribute: Attribut
602 label_attribute: Attribut
602 label_attribute_plural: Attributs
603 label_attribute_plural: Attributs
603 label_no_data: Aucune donnée à afficher
604 label_no_data: Aucune donnée à afficher
604 label_change_status: Changer le statut
605 label_change_status: Changer le statut
605 label_history: Historique
606 label_history: Historique
606 label_attachment: Fichier
607 label_attachment: Fichier
607 label_attachment_new: Nouveau fichier
608 label_attachment_new: Nouveau fichier
608 label_attachment_delete: Supprimer le fichier
609 label_attachment_delete: Supprimer le fichier
609 label_attachment_plural: Fichiers
610 label_attachment_plural: Fichiers
610 label_file_added: Fichier ajouté
611 label_file_added: Fichier ajouté
611 label_report: Rapport
612 label_report: Rapport
612 label_report_plural: Rapports
613 label_report_plural: Rapports
613 label_news: Annonce
614 label_news: Annonce
614 label_news_new: Nouvelle annonce
615 label_news_new: Nouvelle annonce
615 label_news_plural: Annonces
616 label_news_plural: Annonces
616 label_news_latest: Dernières annonces
617 label_news_latest: Dernières annonces
617 label_news_view_all: Voir toutes les annonces
618 label_news_view_all: Voir toutes les annonces
618 label_news_added: Annonce ajoutée
619 label_news_added: Annonce ajoutée
619 label_news_comment_added: Commentaire ajouté à une annonce
620 label_news_comment_added: Commentaire ajouté à une annonce
620 label_settings: Configuration
621 label_settings: Configuration
621 label_overview: Aperçu
622 label_overview: Aperçu
622 label_version: Version
623 label_version: Version
623 label_version_new: Nouvelle version
624 label_version_new: Nouvelle version
624 label_version_plural: Versions
625 label_version_plural: Versions
625 label_close_versions: Fermer les versions terminées
626 label_close_versions: Fermer les versions terminées
626 label_confirmation: Confirmation
627 label_confirmation: Confirmation
627 label_export_to: 'Formats disponibles :'
628 label_export_to: 'Formats disponibles :'
628 label_read: Lire...
629 label_read: Lire...
629 label_public_projects: Projets publics
630 label_public_projects: Projets publics
630 label_open_issues: ouvert
631 label_open_issues: ouvert
631 label_open_issues_plural: ouverts
632 label_open_issues_plural: ouverts
632 label_closed_issues: fermé
633 label_closed_issues: fermé
633 label_closed_issues_plural: fermés
634 label_closed_issues_plural: fermés
634 label_x_open_issues_abbr_on_total:
635 label_x_open_issues_abbr_on_total:
635 zero: 0 ouverte sur %{total}
636 zero: 0 ouverte sur %{total}
636 one: 1 ouverte sur %{total}
637 one: 1 ouverte sur %{total}
637 other: "%{count} ouvertes sur %{total}"
638 other: "%{count} ouvertes sur %{total}"
638 label_x_open_issues_abbr:
639 label_x_open_issues_abbr:
639 zero: 0 ouverte
640 zero: 0 ouverte
640 one: 1 ouverte
641 one: 1 ouverte
641 other: "%{count} ouvertes"
642 other: "%{count} ouvertes"
642 label_x_closed_issues_abbr:
643 label_x_closed_issues_abbr:
643 zero: 0 fermée
644 zero: 0 fermée
644 one: 1 fermée
645 one: 1 fermée
645 other: "%{count} fermées"
646 other: "%{count} fermées"
646 label_x_issues:
647 label_x_issues:
647 zero: 0 demande
648 zero: 0 demande
648 one: 1 demande
649 one: 1 demande
649 other: "%{count} demandes"
650 other: "%{count} demandes"
650 label_total: Total
651 label_total: Total
651 label_total_time: Temps total
652 label_total_time: Temps total
652 label_permissions: Permissions
653 label_permissions: Permissions
653 label_current_status: Statut actuel
654 label_current_status: Statut actuel
654 label_new_statuses_allowed: Nouveaux statuts autorisés
655 label_new_statuses_allowed: Nouveaux statuts autorisés
655 label_all: tous
656 label_all: tous
656 label_any: tous
657 label_any: tous
657 label_none: aucun
658 label_none: aucun
658 label_nobody: personne
659 label_nobody: personne
659 label_next: Suivant
660 label_next: Suivant
660 label_previous: Précédent
661 label_previous: Précédent
661 label_used_by: Utilisé par
662 label_used_by: Utilisé par
662 label_details: Détails
663 label_details: Détails
663 label_add_note: Ajouter une note
664 label_add_note: Ajouter une note
664 label_per_page: Par page
665 label_per_page: Par page
665 label_calendar: Calendrier
666 label_calendar: Calendrier
666 label_months_from: mois depuis
667 label_months_from: mois depuis
667 label_gantt: Gantt
668 label_gantt: Gantt
668 label_internal: Interne
669 label_internal: Interne
669 label_last_changes: "%{count} derniers changements"
670 label_last_changes: "%{count} derniers changements"
670 label_change_view_all: Voir tous les changements
671 label_change_view_all: Voir tous les changements
671 label_personalize_page: Personnaliser cette page
672 label_personalize_page: Personnaliser cette page
672 label_comment: Commentaire
673 label_comment: Commentaire
673 label_comment_plural: Commentaires
674 label_comment_plural: Commentaires
674 label_x_comments:
675 label_x_comments:
675 zero: aucun commentaire
676 zero: aucun commentaire
676 one: un commentaire
677 one: un commentaire
677 other: "%{count} commentaires"
678 other: "%{count} commentaires"
678 label_comment_add: Ajouter un commentaire
679 label_comment_add: Ajouter un commentaire
679 label_comment_added: Commentaire ajouté
680 label_comment_added: Commentaire ajouté
680 label_comment_delete: Supprimer les commentaires
681 label_comment_delete: Supprimer les commentaires
681 label_query: Rapport personnalisé
682 label_query: Rapport personnalisé
682 label_query_plural: Rapports personnalisés
683 label_query_plural: Rapports personnalisés
683 label_query_new: Nouveau rapport
684 label_query_new: Nouveau rapport
684 label_my_queries: Mes rapports personnalisés
685 label_my_queries: Mes rapports personnalisés
685 label_filter_add: Ajouter le filtre
686 label_filter_add: Ajouter le filtre
686 label_filter_plural: Filtres
687 label_filter_plural: Filtres
687 label_equals: égal
688 label_equals: égal
688 label_not_equals: différent
689 label_not_equals: différent
689 label_in_less_than: dans moins de
690 label_in_less_than: dans moins de
690 label_in_more_than: dans plus de
691 label_in_more_than: dans plus de
691 label_in_the_next_days: dans les prochains jours
692 label_in_the_next_days: dans les prochains jours
692 label_in_the_past_days: dans les derniers jours
693 label_in_the_past_days: dans les derniers jours
693 label_greater_or_equal: '>='
694 label_greater_or_equal: '>='
694 label_less_or_equal: '<='
695 label_less_or_equal: '<='
695 label_between: entre
696 label_between: entre
696 label_in: dans
697 label_in: dans
697 label_today: aujourd'hui
698 label_today: aujourd'hui
698 label_all_time: toute la période
699 label_all_time: toute la période
699 label_yesterday: hier
700 label_yesterday: hier
700 label_this_week: cette semaine
701 label_this_week: cette semaine
701 label_last_week: la semaine dernière
702 label_last_week: la semaine dernière
702 label_last_n_weeks: "les %{count} dernières semaines"
703 label_last_n_weeks: "les %{count} dernières semaines"
703 label_last_n_days: "les %{count} derniers jours"
704 label_last_n_days: "les %{count} derniers jours"
704 label_this_month: ce mois-ci
705 label_this_month: ce mois-ci
705 label_last_month: le mois dernier
706 label_last_month: le mois dernier
706 label_this_year: cette année
707 label_this_year: cette année
707 label_date_range: Période
708 label_date_range: Période
708 label_less_than_ago: il y a moins de
709 label_less_than_ago: il y a moins de
709 label_more_than_ago: il y a plus de
710 label_more_than_ago: il y a plus de
710 label_ago: il y a
711 label_ago: il y a
711 label_contains: contient
712 label_contains: contient
712 label_not_contains: ne contient pas
713 label_not_contains: ne contient pas
713 label_any_issues_in_project: une demande du projet
714 label_any_issues_in_project: une demande du projet
714 label_any_issues_not_in_project: une demande hors du projet
715 label_any_issues_not_in_project: une demande hors du projet
715 label_no_issues_in_project: aucune demande du projet
716 label_no_issues_in_project: aucune demande du projet
716 label_day_plural: jours
717 label_day_plural: jours
717 label_repository: Dépôt
718 label_repository: Dépôt
718 label_repository_new: Nouveau dépôt
719 label_repository_new: Nouveau dépôt
719 label_repository_plural: Dépôts
720 label_repository_plural: Dépôts
720 label_browse: Parcourir
721 label_browse: Parcourir
721 label_branch: Branche
722 label_branch: Branche
722 label_tag: Tag
723 label_tag: Tag
723 label_revision: Révision
724 label_revision: Révision
724 label_revision_plural: Révisions
725 label_revision_plural: Révisions
725 label_revision_id: "Révision %{value}"
726 label_revision_id: "Révision %{value}"
726 label_associated_revisions: Révisions associées
727 label_associated_revisions: Révisions associées
727 label_added: ajouté
728 label_added: ajouté
728 label_modified: modifié
729 label_modified: modifié
729 label_copied: copié
730 label_copied: copié
730 label_renamed: renommé
731 label_renamed: renommé
731 label_deleted: supprimé
732 label_deleted: supprimé
732 label_latest_revision: Dernière révision
733 label_latest_revision: Dernière révision
733 label_latest_revision_plural: Dernières révisions
734 label_latest_revision_plural: Dernières révisions
734 label_view_revisions: Voir les révisions
735 label_view_revisions: Voir les révisions
735 label_view_all_revisions: Voir toutes les révisions
736 label_view_all_revisions: Voir toutes les révisions
736 label_max_size: Taille maximale
737 label_max_size: Taille maximale
737 label_sort_highest: Remonter en premier
738 label_sort_highest: Remonter en premier
738 label_sort_higher: Remonter
739 label_sort_higher: Remonter
739 label_sort_lower: Descendre
740 label_sort_lower: Descendre
740 label_sort_lowest: Descendre en dernier
741 label_sort_lowest: Descendre en dernier
741 label_roadmap: Roadmap
742 label_roadmap: Roadmap
742 label_roadmap_due_in: "Échéance dans %{value}"
743 label_roadmap_due_in: "Échéance dans %{value}"
743 label_roadmap_overdue: "En retard de %{value}"
744 label_roadmap_overdue: "En retard de %{value}"
744 label_roadmap_no_issues: Aucune demande pour cette version
745 label_roadmap_no_issues: Aucune demande pour cette version
745 label_search: Recherche
746 label_search: Recherche
746 label_result_plural: Résultats
747 label_result_plural: Résultats
747 label_all_words: Tous les mots
748 label_all_words: Tous les mots
748 label_wiki: Wiki
749 label_wiki: Wiki
749 label_wiki_edit: Révision wiki
750 label_wiki_edit: Révision wiki
750 label_wiki_edit_plural: Révisions wiki
751 label_wiki_edit_plural: Révisions wiki
751 label_wiki_page: Page wiki
752 label_wiki_page: Page wiki
752 label_wiki_page_plural: Pages wiki
753 label_wiki_page_plural: Pages wiki
753 label_index_by_title: Index par titre
754 label_index_by_title: Index par titre
754 label_index_by_date: Index par date
755 label_index_by_date: Index par date
755 label_current_version: Version actuelle
756 label_current_version: Version actuelle
756 label_preview: Prévisualisation
757 label_preview: Prévisualisation
757 label_feed_plural: Flux Atom
758 label_feed_plural: Flux Atom
758 label_changes_details: Détails de tous les changements
759 label_changes_details: Détails de tous les changements
759 label_issue_tracking: Suivi des demandes
760 label_issue_tracking: Suivi des demandes
760 label_spent_time: Temps passé
761 label_spent_time: Temps passé
761 label_overall_spent_time: Temps passé global
762 label_overall_spent_time: Temps passé global
762 label_f_hour: "%{value} heure"
763 label_f_hour: "%{value} heure"
763 label_f_hour_plural: "%{value} heures"
764 label_f_hour_plural: "%{value} heures"
764 label_time_tracking: Suivi du temps
765 label_time_tracking: Suivi du temps
765 label_change_plural: Changements
766 label_change_plural: Changements
766 label_statistics: Statistiques
767 label_statistics: Statistiques
767 label_commits_per_month: Commits par mois
768 label_commits_per_month: Commits par mois
768 label_commits_per_author: Commits par auteur
769 label_commits_per_author: Commits par auteur
769 label_diff: diff
770 label_diff: diff
770 label_view_diff: Voir les différences
771 label_view_diff: Voir les différences
771 label_diff_inline: en ligne
772 label_diff_inline: en ligne
772 label_diff_side_by_side: côte à côte
773 label_diff_side_by_side: côte à côte
773 label_options: Options
774 label_options: Options
774 label_copy_workflow_from: Copier le workflow de
775 label_copy_workflow_from: Copier le workflow de
775 label_permissions_report: Synthèse des permissions
776 label_permissions_report: Synthèse des permissions
776 label_watched_issues: Demandes surveillées
777 label_watched_issues: Demandes surveillées
777 label_related_issues: Demandes liées
778 label_related_issues: Demandes liées
778 label_applied_status: Statut appliqué
779 label_applied_status: Statut appliqué
779 label_loading: Chargement...
780 label_loading: Chargement...
780 label_relation_new: Nouvelle relation
781 label_relation_new: Nouvelle relation
781 label_relation_delete: Supprimer la relation
782 label_relation_delete: Supprimer la relation
782 label_relates_to: Lié à
783 label_relates_to: Lié à
783 label_duplicates: Duplique
784 label_duplicates: Duplique
784 label_duplicated_by: Dupliqué par
785 label_duplicated_by: Dupliqué par
785 label_blocks: Bloque
786 label_blocks: Bloque
786 label_blocked_by: Bloqué par
787 label_blocked_by: Bloqué par
787 label_precedes: Précède
788 label_precedes: Précède
788 label_follows: Suit
789 label_follows: Suit
789 label_copied_to: Copié vers
790 label_copied_to: Copié vers
790 label_copied_from: Copié depuis
791 label_copied_from: Copié depuis
791 label_end_to_start: fin à début
792 label_end_to_start: fin à début
792 label_end_to_end: fin à fin
793 label_end_to_end: fin à fin
793 label_start_to_start: début à début
794 label_start_to_start: début à début
794 label_start_to_end: début à fin
795 label_start_to_end: début à fin
795 label_stay_logged_in: Rester connecté
796 label_stay_logged_in: Rester connecté
796 label_disabled: désactivé
797 label_disabled: désactivé
797 label_show_completed_versions: Voir les versions passées
798 label_show_completed_versions: Voir les versions passées
798 label_me: moi
799 label_me: moi
799 label_board: Forum
800 label_board: Forum
800 label_board_new: Nouveau forum
801 label_board_new: Nouveau forum
801 label_board_plural: Forums
802 label_board_plural: Forums
802 label_board_locked: Verrouillé
803 label_board_locked: Verrouillé
803 label_board_sticky: Sticky
804 label_board_sticky: Sticky
804 label_topic_plural: Discussions
805 label_topic_plural: Discussions
805 label_message_plural: Messages
806 label_message_plural: Messages
806 label_message_last: Dernier message
807 label_message_last: Dernier message
807 label_message_new: Nouveau message
808 label_message_new: Nouveau message
808 label_message_posted: Message ajouté
809 label_message_posted: Message ajouté
809 label_reply_plural: Réponses
810 label_reply_plural: Réponses
810 label_send_information: Envoyer les informations à l'utilisateur
811 label_send_information: Envoyer les informations à l'utilisateur
811 label_year: Année
812 label_year: Année
812 label_month: Mois
813 label_month: Mois
813 label_week: Semaine
814 label_week: Semaine
814 label_date_from: Du
815 label_date_from: Du
815 label_date_to: Au
816 label_date_to: Au
816 label_language_based: Basé sur la langue de l'utilisateur
817 label_language_based: Basé sur la langue de l'utilisateur
817 label_sort_by: "Trier par %{value}"
818 label_sort_by: "Trier par %{value}"
818 label_send_test_email: Envoyer un email de test
819 label_send_test_email: Envoyer un email de test
819 label_feeds_access_key: Clé d'accès Atom
820 label_feeds_access_key: Clé d'accès Atom
820 label_missing_feeds_access_key: Clé d'accès Atom manquante
821 label_missing_feeds_access_key: Clé d'accès Atom manquante
821 label_feeds_access_key_created_on: "Clé d'accès Atom créée il y a %{value}"
822 label_feeds_access_key_created_on: "Clé d'accès Atom créée il y a %{value}"
822 label_module_plural: Modules
823 label_module_plural: Modules
823 label_added_time_by: "Ajouté par %{author} il y a %{age}"
824 label_added_time_by: "Ajouté par %{author} il y a %{age}"
824 label_updated_time_by: "Mis à jour par %{author} il y a %{age}"
825 label_updated_time_by: "Mis à jour par %{author} il y a %{age}"
825 label_updated_time: "Mis à jour il y a %{value}"
826 label_updated_time: "Mis à jour il y a %{value}"
826 label_jump_to_a_project: Aller à un projet...
827 label_jump_to_a_project: Aller à un projet...
827 label_file_plural: Fichiers
828 label_file_plural: Fichiers
828 label_changeset_plural: Révisions
829 label_changeset_plural: Révisions
829 label_default_columns: Colonnes par défaut
830 label_default_columns: Colonnes par défaut
830 label_no_change_option: (Pas de changement)
831 label_no_change_option: (Pas de changement)
831 label_bulk_edit_selected_issues: Modifier les demandes sélectionnées
832 label_bulk_edit_selected_issues: Modifier les demandes sélectionnées
832 label_bulk_edit_selected_time_entries: Modifier les temps passés sélectionnés
833 label_bulk_edit_selected_time_entries: Modifier les temps passés sélectionnés
833 label_theme: Thème
834 label_theme: Thème
834 label_default: Défaut
835 label_default: Défaut
835 label_search_titles_only: Uniquement dans les titres
836 label_search_titles_only: Uniquement dans les titres
836 label_user_mail_option_all: "Pour tous les événements de tous mes projets"
837 label_user_mail_option_all: "Pour tous les événements de tous mes projets"
837 label_user_mail_option_selected: "Pour tous les événements des projets sélectionnés..."
838 label_user_mail_option_selected: "Pour tous les événements des projets sélectionnés..."
838 label_user_mail_option_none: Aucune notification
839 label_user_mail_option_none: Aucune notification
839 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
840 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
840 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assigné
841 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assigné
841 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
842 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
842 label_user_mail_no_self_notified: "Je ne veux pas être notifié des changements que j'effectue"
843 label_user_mail_no_self_notified: "Je ne veux pas être notifié des changements que j'effectue"
843 label_registration_activation_by_email: activation du compte par email
844 label_registration_activation_by_email: activation du compte par email
844 label_registration_manual_activation: activation manuelle du compte
845 label_registration_manual_activation: activation manuelle du compte
845 label_registration_automatic_activation: activation automatique du compte
846 label_registration_automatic_activation: activation automatique du compte
846 label_display_per_page: "Par page : %{value}"
847 label_display_per_page: "Par page : %{value}"
847 label_age: Âge
848 label_age: Âge
848 label_change_properties: Changer les propriétés
849 label_change_properties: Changer les propriétés
849 label_general: Général
850 label_general: Général
850 label_more: Plus
851 label_more: Plus
851 label_scm: SCM
852 label_scm: SCM
852 label_plugins: Plugins
853 label_plugins: Plugins
853 label_ldap_authentication: Authentification LDAP
854 label_ldap_authentication: Authentification LDAP
854 label_downloads_abbr: D/L
855 label_downloads_abbr: D/L
855 label_optional_description: Description facultative
856 label_optional_description: Description facultative
856 label_add_another_file: Ajouter un autre fichier
857 label_add_another_file: Ajouter un autre fichier
857 label_preferences: Préférences
858 label_preferences: Préférences
858 label_chronological_order: Dans l'ordre chronologique
859 label_chronological_order: Dans l'ordre chronologique
859 label_reverse_chronological_order: Dans l'ordre chronologique inverse
860 label_reverse_chronological_order: Dans l'ordre chronologique inverse
860 label_planning: Planning
861 label_planning: Planning
861 label_incoming_emails: Emails entrants
862 label_incoming_emails: Emails entrants
862 label_generate_key: Générer une clé
863 label_generate_key: Générer une clé
863 label_issue_watchers: Observateurs
864 label_issue_watchers: Observateurs
864 label_example: Exemple
865 label_example: Exemple
865 label_display: Affichage
866 label_display: Affichage
866 label_sort: Tri
867 label_sort: Tri
867 label_ascending: Croissant
868 label_ascending: Croissant
868 label_descending: Décroissant
869 label_descending: Décroissant
869 label_date_from_to: Du %{start} au %{end}
870 label_date_from_to: Du %{start} au %{end}
870 label_wiki_content_added: Page wiki ajoutée
871 label_wiki_content_added: Page wiki ajoutée
871 label_wiki_content_updated: Page wiki mise à jour
872 label_wiki_content_updated: Page wiki mise à jour
872 label_group: Groupe
873 label_group: Groupe
873 label_group_plural: Groupes
874 label_group_plural: Groupes
874 label_group_new: Nouveau groupe
875 label_group_new: Nouveau groupe
875 label_group_anonymous: Utilisateurs anonymes
876 label_group_anonymous: Utilisateurs anonymes
876 label_group_non_member: Utilisateurs non membres
877 label_group_non_member: Utilisateurs non membres
877 label_time_entry_plural: Temps passé
878 label_time_entry_plural: Temps passé
878 label_version_sharing_none: Non partagé
879 label_version_sharing_none: Non partagé
879 label_version_sharing_descendants: Avec les sous-projets
880 label_version_sharing_descendants: Avec les sous-projets
880 label_version_sharing_hierarchy: Avec toute la hiérarchie
881 label_version_sharing_hierarchy: Avec toute la hiérarchie
881 label_version_sharing_tree: Avec tout l'arbre
882 label_version_sharing_tree: Avec tout l'arbre
882 label_version_sharing_system: Avec tous les projets
883 label_version_sharing_system: Avec tous les projets
883 label_update_issue_done_ratios: Mettre à jour l'avancement des demandes
884 label_update_issue_done_ratios: Mettre à jour l'avancement des demandes
884 label_copy_source: Source
885 label_copy_source: Source
885 label_copy_target: Cible
886 label_copy_target: Cible
886 label_copy_same_as_target: Comme la cible
887 label_copy_same_as_target: Comme la cible
887 label_display_used_statuses_only: N'afficher que les statuts utilisés dans ce tracker
888 label_display_used_statuses_only: N'afficher que les statuts utilisés dans ce tracker
888 label_api_access_key: Clé d'accès API
889 label_api_access_key: Clé d'accès API
889 label_missing_api_access_key: Clé d'accès API manquante
890 label_missing_api_access_key: Clé d'accès API manquante
890 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
891 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
891 label_profile: Profil
892 label_profile: Profil
892 label_subtask_plural: Sous-tâches
893 label_subtask_plural: Sous-tâches
893 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
894 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
894 label_principal_search: "Rechercher un utilisateur ou un groupe :"
895 label_principal_search: "Rechercher un utilisateur ou un groupe :"
895 label_user_search: "Rechercher un utilisateur :"
896 label_user_search: "Rechercher un utilisateur :"
896 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
897 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
897 label_additional_workflow_transitions_for_assignee: Autorisations supplémentaires lorsque la demande est assignée à l'utilisateur
898 label_additional_workflow_transitions_for_assignee: Autorisations supplémentaires lorsque la demande est assignée à l'utilisateur
898 label_issues_visibility_all: Toutes les demandes
899 label_issues_visibility_all: Toutes les demandes
899 label_issues_visibility_public: Toutes les demandes non privées
900 label_issues_visibility_public: Toutes les demandes non privées
900 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
901 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
901 label_git_report_last_commit: Afficher le dernier commit des fichiers et répertoires
902 label_git_report_last_commit: Afficher le dernier commit des fichiers et répertoires
902 label_parent_revision: Parent
903 label_parent_revision: Parent
903 label_child_revision: Enfant
904 label_child_revision: Enfant
904 label_export_options: Options d'exportation %{export_format}
905 label_export_options: Options d'exportation %{export_format}
905 label_copy_attachments: Copier les fichiers
906 label_copy_attachments: Copier les fichiers
906 label_copy_subtasks: Copier les sous-tâches
907 label_copy_subtasks: Copier les sous-tâches
907 label_item_position: "%{position} sur %{count}"
908 label_item_position: "%{position} sur %{count}"
908 label_completed_versions: Versions passées
909 label_completed_versions: Versions passées
909 label_search_for_watchers: Rechercher des observateurs
910 label_search_for_watchers: Rechercher des observateurs
910 label_session_expiration: Expiration des sessions
911 label_session_expiration: Expiration des sessions
911 label_show_closed_projects: Voir les projets fermés
912 label_show_closed_projects: Voir les projets fermés
912 label_status_transitions: Changements de statut
913 label_status_transitions: Changements de statut
913 label_fields_permissions: Permissions sur les champs
914 label_fields_permissions: Permissions sur les champs
914 label_readonly: Lecture
915 label_readonly: Lecture
915 label_required: Obligatoire
916 label_required: Obligatoire
916 label_hidden: Caché
917 label_hidden: Caché
917 label_attribute_of_project: "%{name} du projet"
918 label_attribute_of_project: "%{name} du projet"
918 label_attribute_of_issue: "%{name} de la demande"
919 label_attribute_of_issue: "%{name} de la demande"
919 label_attribute_of_author: "%{name} de l'auteur"
920 label_attribute_of_author: "%{name} de l'auteur"
920 label_attribute_of_assigned_to: "%{name} de l'assigné"
921 label_attribute_of_assigned_to: "%{name} de l'assigné"
921 label_attribute_of_user: "%{name} de l'utilisateur"
922 label_attribute_of_user: "%{name} de l'utilisateur"
922 label_attribute_of_fixed_version: "%{name} de la version cible"
923 label_attribute_of_fixed_version: "%{name} de la version cible"
923 label_cross_project_descendants: Avec les sous-projets
924 label_cross_project_descendants: Avec les sous-projets
924 label_cross_project_tree: Avec tout l'arbre
925 label_cross_project_tree: Avec tout l'arbre
925 label_cross_project_hierarchy: Avec toute la hiérarchie
926 label_cross_project_hierarchy: Avec toute la hiérarchie
926 label_cross_project_system: Avec tous les projets
927 label_cross_project_system: Avec tous les projets
927 label_gantt_progress_line: Ligne de progression
928 label_gantt_progress_line: Ligne de progression
928 label_visibility_private: par moi uniquement
929 label_visibility_private: par moi uniquement
929 label_visibility_roles: par ces rôles uniquement
930 label_visibility_roles: par ces rôles uniquement
930 label_visibility_public: par tout le monde
931 label_visibility_public: par tout le monde
931 label_link: Lien
932 label_link: Lien
932 label_only: seulement
933 label_only: seulement
933 label_drop_down_list: liste déroulante
934 label_drop_down_list: liste déroulante
934 label_checkboxes: cases à cocher
935 label_checkboxes: cases à cocher
935 label_radio_buttons: boutons radio
936 label_radio_buttons: boutons radio
936 label_link_values_to: Lier les valeurs vers l'URL
937 label_link_values_to: Lier les valeurs vers l'URL
937 label_custom_field_select_type: Selectionner le type d'objet auquel attacher le champ personnalisé
938 label_custom_field_select_type: Selectionner le type d'objet auquel attacher le champ personnalisé
938 label_check_for_updates: Vérifier les mises à jour
939 label_check_for_updates: Vérifier les mises à jour
939 label_latest_compatible_version: Dernière version compatible
940 label_latest_compatible_version: Dernière version compatible
940 label_unknown_plugin: Plugin inconnu
941 label_unknown_plugin: Plugin inconnu
941 label_add_projects: Ajouter des projets
942 label_add_projects: Ajouter des projets
942
943
943 button_login: Connexion
944 button_login: Connexion
944 button_submit: Soumettre
945 button_submit: Soumettre
945 button_save: Sauvegarder
946 button_save: Sauvegarder
946 button_check_all: Tout cocher
947 button_check_all: Tout cocher
947 button_uncheck_all: Tout décocher
948 button_uncheck_all: Tout décocher
948 button_collapse_all: Plier tout
949 button_collapse_all: Plier tout
949 button_expand_all: Déplier tout
950 button_expand_all: Déplier tout
950 button_delete: Supprimer
951 button_delete: Supprimer
951 button_create: Créer
952 button_create: Créer
952 button_create_and_continue: Créer et continuer
953 button_create_and_continue: Créer et continuer
953 button_test: Tester
954 button_test: Tester
954 button_edit: Modifier
955 button_edit: Modifier
955 button_edit_associated_wikipage: "Modifier la page wiki associée: %{page_title}"
956 button_edit_associated_wikipage: "Modifier la page wiki associée: %{page_title}"
956 button_add: Ajouter
957 button_add: Ajouter
957 button_change: Changer
958 button_change: Changer
958 button_apply: Appliquer
959 button_apply: Appliquer
959 button_clear: Effacer
960 button_clear: Effacer
960 button_lock: Verrouiller
961 button_lock: Verrouiller
961 button_unlock: Déverrouiller
962 button_unlock: Déverrouiller
962 button_download: Télécharger
963 button_download: Télécharger
963 button_list: Lister
964 button_list: Lister
964 button_view: Voir
965 button_view: Voir
965 button_move: Déplacer
966 button_move: Déplacer
966 button_move_and_follow: Déplacer et suivre
967 button_move_and_follow: Déplacer et suivre
967 button_back: Retour
968 button_back: Retour
968 button_cancel: Annuler
969 button_cancel: Annuler
969 button_activate: Activer
970 button_activate: Activer
970 button_sort: Trier
971 button_sort: Trier
971 button_log_time: Saisir temps
972 button_log_time: Saisir temps
972 button_rollback: Revenir à cette version
973 button_rollback: Revenir à cette version
973 button_watch: Surveiller
974 button_watch: Surveiller
974 button_unwatch: Ne plus surveiller
975 button_unwatch: Ne plus surveiller
975 button_reply: Répondre
976 button_reply: Répondre
976 button_archive: Archiver
977 button_archive: Archiver
977 button_unarchive: Désarchiver
978 button_unarchive: Désarchiver
978 button_reset: Réinitialiser
979 button_reset: Réinitialiser
979 button_rename: Renommer
980 button_rename: Renommer
980 button_change_password: Changer de mot de passe
981 button_change_password: Changer de mot de passe
981 button_copy: Copier
982 button_copy: Copier
982 button_copy_and_follow: Copier et suivre
983 button_copy_and_follow: Copier et suivre
983 button_annotate: Annoter
984 button_annotate: Annoter
984 button_update: Mettre à jour
985 button_update: Mettre à jour
985 button_configure: Configurer
986 button_configure: Configurer
986 button_quote: Citer
987 button_quote: Citer
987 button_duplicate: Dupliquer
988 button_duplicate: Dupliquer
988 button_show: Afficher
989 button_show: Afficher
989 button_hide: Cacher
990 button_hide: Cacher
990 button_edit_section: Modifier cette section
991 button_edit_section: Modifier cette section
991 button_export: Exporter
992 button_export: Exporter
992 button_delete_my_account: Supprimer mon compte
993 button_delete_my_account: Supprimer mon compte
993 button_close: Fermer
994 button_close: Fermer
994 button_reopen: Réouvrir
995 button_reopen: Réouvrir
995
996
996 status_active: actif
997 status_active: actif
997 status_registered: enregistré
998 status_registered: enregistré
998 status_locked: verrouillé
999 status_locked: verrouillé
999
1000
1000 project_status_active: actif
1001 project_status_active: actif
1001 project_status_closed: fermé
1002 project_status_closed: fermé
1002 project_status_archived: archivé
1003 project_status_archived: archivé
1003
1004
1004 version_status_open: ouvert
1005 version_status_open: ouvert
1005 version_status_locked: verrouillé
1006 version_status_locked: verrouillé
1006 version_status_closed: fermé
1007 version_status_closed: fermé
1007
1008
1008 field_active: Actif
1009 field_active: Actif
1009
1010
1010 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyée
1011 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyée
1011 text_regexp_info: ex. ^[A-Z0-9]+$
1012 text_regexp_info: ex. ^[A-Z0-9]+$
1012 text_min_max_length_info: 0 pour aucune restriction
1013 text_min_max_length_info: 0 pour aucune restriction
1013 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
1014 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
1014 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront également supprimés."
1015 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront également supprimés."
1015 text_workflow_edit: Sélectionner un tracker et un rôle pour éditer le workflow
1016 text_workflow_edit: Sélectionner un tracker et un rôle pour éditer le workflow
1016 text_are_you_sure: Êtes-vous sûr ?
1017 text_are_you_sure: Êtes-vous sûr ?
1017 text_journal_changed: "%{label} changé de %{old} à %{new}"
1018 text_journal_changed: "%{label} changé de %{old} à %{new}"
1018 text_journal_changed_no_detail: "%{label} mis à jour"
1019 text_journal_changed_no_detail: "%{label} mis à jour"
1019 text_journal_set_to: "%{label} mis à %{value}"
1020 text_journal_set_to: "%{label} mis à %{value}"
1020 text_journal_deleted: "%{label} %{old} supprimé"
1021 text_journal_deleted: "%{label} %{old} supprimé"
1021 text_journal_added: "%{label} %{value} ajouté"
1022 text_journal_added: "%{label} %{value} ajouté"
1022 text_tip_issue_begin_day: tâche commençant ce jour
1023 text_tip_issue_begin_day: tâche commençant ce jour
1023 text_tip_issue_end_day: tâche finissant ce jour
1024 text_tip_issue_end_day: tâche finissant ce jour
1024 text_tip_issue_begin_end_day: tâche commençant et finissant ce jour
1025 text_tip_issue_begin_end_day: tâche commençant et finissant ce jour
1025 text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et tirets bas sont autorisés, doit commencer par une minuscule.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
1026 text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et tirets bas sont autorisés, doit commencer par une minuscule.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
1026 text_caracters_maximum: "%{count} caractères maximum."
1027 text_caracters_maximum: "%{count} caractères maximum."
1027 text_caracters_minimum: "%{count} caractères minimum."
1028 text_caracters_minimum: "%{count} caractères minimum."
1028 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
1029 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
1029 text_tracker_no_workflow: Aucun worflow n'est défini pour ce tracker
1030 text_tracker_no_workflow: Aucun worflow n'est défini pour ce tracker
1030 text_unallowed_characters: Caractères non autorisés
1031 text_unallowed_characters: Caractères non autorisés
1031 text_comma_separated: Plusieurs valeurs possibles (séparées par des virgules).
1032 text_comma_separated: Plusieurs valeurs possibles (séparées par des virgules).
1032 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
1033 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
1033 text_issues_ref_in_commit_messages: Référencement et résolution des demandes dans les commentaires de commits
1034 text_issues_ref_in_commit_messages: Référencement et résolution des demandes dans les commentaires de commits
1034 text_issue_added: "La demande %{id} a été soumise par %{author}."
1035 text_issue_added: "La demande %{id} a été soumise par %{author}."
1035 text_issue_updated: "La demande %{id} a été mise à jour par %{author}."
1036 text_issue_updated: "La demande %{id} a été mise à jour par %{author}."
1036 text_wiki_destroy_confirmation: Etes-vous sûr de vouloir supprimer ce wiki et tout son contenu ?
1037 text_wiki_destroy_confirmation: Etes-vous sûr de vouloir supprimer ce wiki et tout son contenu ?
1037 text_issue_category_destroy_question: "%{count} demandes sont affectées à cette catégorie. Que voulez-vous faire ?"
1038 text_issue_category_destroy_question: "%{count} demandes sont affectées à cette catégorie. Que voulez-vous faire ?"
1038 text_issue_category_destroy_assignments: N'affecter les demandes à aucune autre catégorie
1039 text_issue_category_destroy_assignments: N'affecter les demandes à aucune autre catégorie
1039 text_issue_category_reassign_to: Réaffecter les demandes à cette catégorie
1040 text_issue_category_reassign_to: Réaffecter les demandes à cette catégorie
1040 text_user_mail_option: "Pour les projets non sélectionnés, vous recevrez seulement des notifications pour ce que vous surveillez ou à quoi vous participez (exemple: demandes dont vous êtes l'auteur ou la personne assignée)."
1041 text_user_mail_option: "Pour les projets non sélectionnés, vous recevrez seulement des notifications pour ce que vous surveillez ou à quoi vous participez (exemple: demandes dont vous êtes l'auteur ou la personne assignée)."
1041 text_no_configuration_data: "Les rôles, trackers, statuts et le workflow ne sont pas encore paramétrés.\nIl est vivement recommandé de charger le paramétrage par defaut. Vous pourrez le modifier une fois chargé."
1042 text_no_configuration_data: "Les rôles, trackers, statuts et le workflow ne sont pas encore paramétrés.\nIl est vivement recommandé de charger le paramétrage par defaut. Vous pourrez le modifier une fois chargé."
1042 text_load_default_configuration: Charger le paramétrage par défaut
1043 text_load_default_configuration: Charger le paramétrage par défaut
1043 text_status_changed_by_changeset: "Appliqué par commit %{value}."
1044 text_status_changed_by_changeset: "Appliqué par commit %{value}."
1044 text_time_logged_by_changeset: "Appliqué par commit %{value}"
1045 text_time_logged_by_changeset: "Appliqué par commit %{value}"
1045 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
1046 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
1046 text_issues_destroy_descendants_confirmation: "Cela entrainera également la suppression de %{count} sous-tâche(s)."
1047 text_issues_destroy_descendants_confirmation: "Cela entrainera également la suppression de %{count} sous-tâche(s)."
1047 text_time_entries_destroy_confirmation: "Etes-vous sûr de vouloir supprimer les temps passés sélectionnés ?"
1048 text_time_entries_destroy_confirmation: "Etes-vous sûr de vouloir supprimer les temps passés sélectionnés ?"
1048 text_select_project_modules: 'Sélectionner les modules à activer pour ce projet :'
1049 text_select_project_modules: 'Sélectionner les modules à activer pour ce projet :'
1049 text_default_administrator_account_changed: Compte administrateur par défaut changé
1050 text_default_administrator_account_changed: Compte administrateur par défaut changé
1050 text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture
1051 text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture
1051 text_plugin_assets_writable: Répertoire public des plugins accessible en écriture
1052 text_plugin_assets_writable: Répertoire public des plugins accessible en écriture
1052 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
1053 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
1053 text_convert_available: Binaire convert de ImageMagick présent (optionel)
1054 text_convert_available: Binaire convert de ImageMagick présent (optionel)
1054 text_destroy_time_entries_question: "%{hours} heures ont été enregistrées sur les demandes à supprimer. Que voulez-vous faire ?"
1055 text_destroy_time_entries_question: "%{hours} heures ont été enregistrées sur les demandes à supprimer. Que voulez-vous faire ?"
1055 text_destroy_time_entries: Supprimer les heures
1056 text_destroy_time_entries: Supprimer les heures
1056 text_assign_time_entries_to_project: Reporter les heures sur le projet
1057 text_assign_time_entries_to_project: Reporter les heures sur le projet
1057 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
1058 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
1058 text_user_wrote: "%{value} a écrit :"
1059 text_user_wrote: "%{value} a écrit :"
1059 text_enumeration_destroy_question: "Cette valeur est affectée à %{count} objets."
1060 text_enumeration_destroy_question: "Cette valeur est affectée à %{count} objets."
1060 text_enumeration_category_reassign_to: 'Réaffecter les objets à cette valeur:'
1061 text_enumeration_category_reassign_to: 'Réaffecter les objets à cette valeur:'
1061 text_email_delivery_not_configured: "L'envoi de mail n'est pas configuré, les notifications sont désactivées.\nConfigurez votre serveur SMTP dans config/configuration.yml et redémarrez l'application pour les activer."
1062 text_email_delivery_not_configured: "L'envoi de mail n'est pas configuré, les notifications sont désactivées.\nConfigurez votre serveur SMTP dans config/configuration.yml et redémarrez l'application pour les activer."
1062 text_repository_usernames_mapping: "Vous pouvez sélectionner ou modifier l'utilisateur Redmine associé à chaque nom d'utilisateur figurant dans l'historique du dépôt.\nLes utilisateurs avec le même identifiant ou la même adresse mail seront automatiquement associés."
1063 text_repository_usernames_mapping: "Vous pouvez sélectionner ou modifier l'utilisateur Redmine associé à chaque nom d'utilisateur figurant dans l'historique du dépôt.\nLes utilisateurs avec le même identifiant ou la même adresse mail seront automatiquement associés."
1063 text_diff_truncated: '... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.'
1064 text_diff_truncated: '... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.'
1064 text_custom_field_possible_values_info: 'Une ligne par valeur'
1065 text_custom_field_possible_values_info: 'Une ligne par valeur'
1065 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
1066 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
1066 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
1067 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
1067 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
1068 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
1068 text_wiki_page_reassign_children: "Réaffecter les sous-pages à cette page"
1069 text_wiki_page_reassign_children: "Réaffecter les sous-pages à cette page"
1069 text_own_membership_delete_confirmation: "Vous allez supprimer tout ou partie de vos permissions sur ce projet et ne serez peut-être plus autorisé à modifier ce projet.\nEtes-vous sûr de vouloir continuer ?"
1070 text_own_membership_delete_confirmation: "Vous allez supprimer tout ou partie de vos permissions sur ce projet et ne serez peut-être plus autorisé à modifier ce projet.\nEtes-vous sûr de vouloir continuer ?"
1070 text_zoom_in: Zoom avant
1071 text_zoom_in: Zoom avant
1071 text_zoom_out: Zoom arrière
1072 text_zoom_out: Zoom arrière
1072 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardé qui sera perdu si vous quittez la page."
1073 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardé qui sera perdu si vous quittez la page."
1073 text_scm_path_encoding_note: "Défaut : UTF-8"
1074 text_scm_path_encoding_note: "Défaut : UTF-8"
1074 text_git_repository_note: "Le dépôt est vide et local (exemples : /gitrepo, c:\\gitrepo)"
1075 text_git_repository_note: "Le dépôt est vide et local (exemples : /gitrepo, c:\\gitrepo)"
1075 text_mercurial_repository_note: "Dépôt local (exemples : /hgrepo, c:\\hgrepo)"
1076 text_mercurial_repository_note: "Dépôt local (exemples : /hgrepo, c:\\hgrepo)"
1076 text_scm_command: Commande
1077 text_scm_command: Commande
1077 text_scm_command_version: Version
1078 text_scm_command_version: Version
1078 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1079 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1079 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1080 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1080 text_issue_conflict_resolution_overwrite: "Appliquer quand même ma mise à jour (les notes précédentes seront conservées mais des changements pourront être écrasés)"
1081 text_issue_conflict_resolution_overwrite: "Appliquer quand même ma mise à jour (les notes précédentes seront conservées mais des changements pourront être écrasés)"
1081 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
1082 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
1082 text_issue_conflict_resolution_cancel: "Annuler ma mise à jour et réafficher %{link}"
1083 text_issue_conflict_resolution_cancel: "Annuler ma mise à jour et réafficher %{link}"
1083 text_account_destroy_confirmation: "Êtes-vous sûr de vouloir continuer ?\nVotre compte sera définitivement supprimé, sans aucune possibilité de le réactiver."
1084 text_account_destroy_confirmation: "Êtes-vous sûr de vouloir continuer ?\nVotre compte sera définitivement supprimé, sans aucune possibilité de le réactiver."
1084 text_session_expiration_settings: "Attention : le changement de ces paramètres peut entrainer l'expiration des sessions utilisateurs en cours, y compris la vôtre."
1085 text_session_expiration_settings: "Attention : le changement de ces paramètres peut entrainer l'expiration des sessions utilisateurs en cours, y compris la vôtre."
1085 text_project_closed: Ce projet est fermé et accessible en lecture seule.
1086 text_project_closed: Ce projet est fermé et accessible en lecture seule.
1086 text_turning_multiple_off: "Si vous désactivez les valeurs multiples, les valeurs multiples seront supprimées pour n'en conserver qu'une par objet."
1087 text_turning_multiple_off: "Si vous désactivez les valeurs multiples, les valeurs multiples seront supprimées pour n'en conserver qu'une par objet."
1087
1088
1088 default_role_manager: Manager
1089 default_role_manager: Manager
1089 default_role_developer: Développeur
1090 default_role_developer: Développeur
1090 default_role_reporter: Rapporteur
1091 default_role_reporter: Rapporteur
1091 default_tracker_bug: Anomalie
1092 default_tracker_bug: Anomalie
1092 default_tracker_feature: Evolution
1093 default_tracker_feature: Evolution
1093 default_tracker_support: Assistance
1094 default_tracker_support: Assistance
1094 default_issue_status_new: Nouveau
1095 default_issue_status_new: Nouveau
1095 default_issue_status_in_progress: En cours
1096 default_issue_status_in_progress: En cours
1096 default_issue_status_resolved: Résolu
1097 default_issue_status_resolved: Résolu
1097 default_issue_status_feedback: Commentaire
1098 default_issue_status_feedback: Commentaire
1098 default_issue_status_closed: Fermé
1099 default_issue_status_closed: Fermé
1099 default_issue_status_rejected: Rejeté
1100 default_issue_status_rejected: Rejeté
1100 default_doc_category_user: Documentation utilisateur
1101 default_doc_category_user: Documentation utilisateur
1101 default_doc_category_tech: Documentation technique
1102 default_doc_category_tech: Documentation technique
1102 default_priority_low: Bas
1103 default_priority_low: Bas
1103 default_priority_normal: Normal
1104 default_priority_normal: Normal
1104 default_priority_high: Haut
1105 default_priority_high: Haut
1105 default_priority_urgent: Urgent
1106 default_priority_urgent: Urgent
1106 default_priority_immediate: Immédiat
1107 default_priority_immediate: Immédiat
1107 default_activity_design: Conception
1108 default_activity_design: Conception
1108 default_activity_development: Développement
1109 default_activity_development: Développement
1109
1110
1110 enumeration_issue_priorities: Priorités des demandes
1111 enumeration_issue_priorities: Priorités des demandes
1111 enumeration_doc_categories: Catégories des documents
1112 enumeration_doc_categories: Catégories des documents
1112 enumeration_activities: Activités (suivi du temps)
1113 enumeration_activities: Activités (suivi du temps)
1113 enumeration_system_activity: Activité système
1114 enumeration_system_activity: Activité système
1114 description_filter: Filtre
1115 description_filter: Filtre
1115 description_search: Champ de recherche
1116 description_search: Champ de recherche
1116 description_choose_project: Projets
1117 description_choose_project: Projets
1117 description_project_scope: Périmètre de recherche
1118 description_project_scope: Périmètre de recherche
1118 description_notes: Notes
1119 description_notes: Notes
1119 description_message_content: Contenu du message
1120 description_message_content: Contenu du message
1120 description_query_sort_criteria_attribute: Critère de tri
1121 description_query_sort_criteria_attribute: Critère de tri
1121 description_query_sort_criteria_direction: Ordre de tri
1122 description_query_sort_criteria_direction: Ordre de tri
1122 description_user_mail_notification: Option de notification
1123 description_user_mail_notification: Option de notification
1123 description_available_columns: Colonnes disponibles
1124 description_available_columns: Colonnes disponibles
1124 description_selected_columns: Colonnes sélectionnées
1125 description_selected_columns: Colonnes sélectionnées
1125 description_all_columns: Toutes les colonnes
1126 description_all_columns: Toutes les colonnes
1126 description_issue_category_reassign: Choisir une catégorie
1127 description_issue_category_reassign: Choisir une catégorie
1127 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1128 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1128 description_date_range_list: Choisir une période prédéfinie
1129 description_date_range_list: Choisir une période prédéfinie
1129 description_date_range_interval: Choisir une période
1130 description_date_range_interval: Choisir une période
1130 description_date_from: Date de début
1131 description_date_from: Date de début
1131 description_date_to: Date de fin
1132 description_date_to: Date de fin
1132 text_repository_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et tirets bas sont autorisés.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
1133 text_repository_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et tirets bas sont autorisés.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
@@ -1,185 +1,185
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module Redmine
18 module Redmine
19 module DefaultData
19 module DefaultData
20 class DataAlreadyLoaded < Exception; end
20 class DataAlreadyLoaded < Exception; end
21
21
22 module Loader
22 module Loader
23 include Redmine::I18n
23 include Redmine::I18n
24
24
25 class << self
25 class << self
26 # Returns true if no data is already loaded in the database
26 # Returns true if no data is already loaded in the database
27 # otherwise false
27 # otherwise false
28 def no_data?
28 def no_data?
29 !Role.where(:builtin => 0).exists? &&
29 !Role.where(:builtin => 0).exists? &&
30 !Tracker.exists? &&
30 !Tracker.exists? &&
31 !IssueStatus.exists? &&
31 !IssueStatus.exists? &&
32 !Enumeration.exists?
32 !Enumeration.exists?
33 end
33 end
34
34
35 # Loads the default data
35 # Loads the default data
36 # Raises a RecordNotSaved exception if something goes wrong
36 # Raises a RecordNotSaved exception if something goes wrong
37 def load(lang=nil)
37 def load(lang=nil)
38 raise DataAlreadyLoaded.new("Some configuration data is already loaded.") unless no_data?
38 raise DataAlreadyLoaded.new("Some configuration data is already loaded.") unless no_data?
39 set_language_if_valid(lang)
39 set_language_if_valid(lang)
40
40
41 Role.transaction do
41 Role.transaction do
42 # Roles
42 # Roles
43 manager = Role.create! :name => l(:default_role_manager),
43 manager = Role.create! :name => l(:default_role_manager),
44 :issues_visibility => 'all',
44 :issues_visibility => 'all',
45 :position => 1
45 :position => 1
46 manager.permissions = manager.setable_permissions.collect {|p| p.name}
46 manager.permissions = manager.setable_permissions.collect {|p| p.name}
47 manager.save!
47 manager.save!
48
48
49 developer = Role.create! :name => l(:default_role_developer),
49 developer = Role.create! :name => l(:default_role_developer),
50 :position => 2,
50 :position => 2,
51 :permissions => [:manage_versions,
51 :permissions => [:manage_versions,
52 :manage_categories,
52 :manage_categories,
53 :view_issues,
53 :view_issues,
54 :add_issues,
54 :add_issues,
55 :edit_issues,
55 :edit_issues,
56 :view_private_notes,
56 :view_private_notes,
57 :set_notes_private,
57 :set_notes_private,
58 :manage_issue_relations,
58 :manage_issue_relations,
59 :manage_subtasks,
59 :manage_subtasks,
60 :add_issue_notes,
60 :add_issue_notes,
61 :save_queries,
61 :save_queries,
62 :view_gantt,
62 :view_gantt,
63 :view_calendar,
63 :view_calendar,
64 :log_time,
64 :log_time,
65 :view_time_entries,
65 :view_time_entries,
66 :comment_news,
66 :comment_news,
67 :view_documents,
67 :view_documents,
68 :view_wiki_pages,
68 :view_wiki_pages,
69 :view_wiki_edits,
69 :view_wiki_edits,
70 :edit_wiki_pages,
70 :edit_wiki_pages,
71 :delete_wiki_pages,
71 :delete_wiki_pages,
72 :add_messages,
72 :add_messages,
73 :edit_own_messages,
73 :edit_own_messages,
74 :view_files,
74 :view_files,
75 :manage_files,
75 :manage_files,
76 :browse_repository,
76 :browse_repository,
77 :view_changesets,
77 :view_changesets,
78 :commit_access,
78 :commit_access,
79 :manage_related_issues]
79 :manage_related_issues]
80
80
81 reporter = Role.create! :name => l(:default_role_reporter),
81 reporter = Role.create! :name => l(:default_role_reporter),
82 :position => 3,
82 :position => 3,
83 :permissions => [:view_issues,
83 :permissions => [:view_issues,
84 :add_issues,
84 :add_issues,
85 :add_issue_notes,
85 :add_issue_notes,
86 :save_queries,
86 :save_queries,
87 :view_gantt,
87 :view_gantt,
88 :view_calendar,
88 :view_calendar,
89 :log_time,
89 :log_time,
90 :view_time_entries,
90 :view_time_entries,
91 :comment_news,
91 :comment_news,
92 :view_documents,
92 :view_documents,
93 :view_wiki_pages,
93 :view_wiki_pages,
94 :view_wiki_edits,
94 :view_wiki_edits,
95 :add_messages,
95 :add_messages,
96 :edit_own_messages,
96 :edit_own_messages,
97 :view_files,
97 :view_files,
98 :browse_repository,
98 :browse_repository,
99 :view_changesets]
99 :view_changesets]
100
100
101 Role.non_member.update_attribute :permissions, [:view_issues,
101 Role.non_member.update_attribute :permissions, [:view_issues,
102 :add_issues,
102 :add_issues,
103 :add_issue_notes,
103 :add_issue_notes,
104 :save_queries,
104 :save_queries,
105 :view_gantt,
105 :view_gantt,
106 :view_calendar,
106 :view_calendar,
107 :view_time_entries,
107 :view_time_entries,
108 :comment_news,
108 :comment_news,
109 :view_documents,
109 :view_documents,
110 :view_wiki_pages,
110 :view_wiki_pages,
111 :view_wiki_edits,
111 :view_wiki_edits,
112 :add_messages,
112 :add_messages,
113 :view_files,
113 :view_files,
114 :browse_repository,
114 :browse_repository,
115 :view_changesets]
115 :view_changesets]
116
116
117 Role.anonymous.update_attribute :permissions, [:view_issues,
117 Role.anonymous.update_attribute :permissions, [:view_issues,
118 :view_gantt,
118 :view_gantt,
119 :view_calendar,
119 :view_calendar,
120 :view_time_entries,
120 :view_time_entries,
121 :view_documents,
121 :view_documents,
122 :view_wiki_pages,
122 :view_wiki_pages,
123 :view_wiki_edits,
123 :view_wiki_edits,
124 :view_files,
124 :view_files,
125 :browse_repository,
125 :browse_repository,
126 :view_changesets]
126 :view_changesets]
127
127
128 # Trackers
129 Tracker.create!(:name => l(:default_tracker_bug), :is_in_chlog => true, :is_in_roadmap => false, :position => 1)
130 Tracker.create!(:name => l(:default_tracker_feature), :is_in_chlog => true, :is_in_roadmap => true, :position => 2)
131 Tracker.create!(:name => l(:default_tracker_support), :is_in_chlog => false, :is_in_roadmap => false, :position => 3)
132
133 # Issue statuses
128 # Issue statuses
134 new = IssueStatus.create!(:name => l(:default_issue_status_new), :is_closed => false, :is_default => true, :position => 1)
129 new = IssueStatus.create!(:name => l(:default_issue_status_new), :is_closed => false, :position => 1)
135 in_progress = IssueStatus.create!(:name => l(:default_issue_status_in_progress), :is_closed => false, :is_default => false, :position => 2)
130 in_progress = IssueStatus.create!(:name => l(:default_issue_status_in_progress), :is_closed => false, :position => 2)
136 resolved = IssueStatus.create!(:name => l(:default_issue_status_resolved), :is_closed => false, :is_default => false, :position => 3)
131 resolved = IssueStatus.create!(:name => l(:default_issue_status_resolved), :is_closed => false, :position => 3)
137 feedback = IssueStatus.create!(:name => l(:default_issue_status_feedback), :is_closed => false, :is_default => false, :position => 4)
132 feedback = IssueStatus.create!(:name => l(:default_issue_status_feedback), :is_closed => false, :position => 4)
138 closed = IssueStatus.create!(:name => l(:default_issue_status_closed), :is_closed => true, :is_default => false, :position => 5)
133 closed = IssueStatus.create!(:name => l(:default_issue_status_closed), :is_closed => true, :position => 5)
139 rejected = IssueStatus.create!(:name => l(:default_issue_status_rejected), :is_closed => true, :is_default => false, :position => 6)
134 rejected = IssueStatus.create!(:name => l(:default_issue_status_rejected), :is_closed => true, :position => 6)
135
136 # Trackers
137 Tracker.create!(:name => l(:default_tracker_bug), :default_status_id => new.id, :is_in_chlog => true, :is_in_roadmap => false, :position => 1)
138 Tracker.create!(:name => l(:default_tracker_feature), :default_status_id => new.id, :is_in_chlog => true, :is_in_roadmap => true, :position => 2)
139 Tracker.create!(:name => l(:default_tracker_support), :default_status_id => new.id, :is_in_chlog => false, :is_in_roadmap => false, :position => 3)
140
140
141 # Workflow
141 # Workflow
142 Tracker.all.each { |t|
142 Tracker.all.each { |t|
143 IssueStatus.all.each { |os|
143 IssueStatus.all.each { |os|
144 IssueStatus.all.each { |ns|
144 IssueStatus.all.each { |ns|
145 WorkflowTransition.create!(:tracker_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
145 WorkflowTransition.create!(:tracker_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
146 }
146 }
147 }
147 }
148 }
148 }
149
149
150 Tracker.all.each { |t|
150 Tracker.all.each { |t|
151 [new, in_progress, resolved, feedback].each { |os|
151 [new, in_progress, resolved, feedback].each { |os|
152 [in_progress, resolved, feedback, closed].each { |ns|
152 [in_progress, resolved, feedback, closed].each { |ns|
153 WorkflowTransition.create!(:tracker_id => t.id, :role_id => developer.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
153 WorkflowTransition.create!(:tracker_id => t.id, :role_id => developer.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
154 }
154 }
155 }
155 }
156 }
156 }
157
157
158 Tracker.all.each { |t|
158 Tracker.all.each { |t|
159 [new, in_progress, resolved, feedback].each { |os|
159 [new, in_progress, resolved, feedback].each { |os|
160 [closed].each { |ns|
160 [closed].each { |ns|
161 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
161 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
162 }
162 }
163 }
163 }
164 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => resolved.id, :new_status_id => feedback.id)
164 WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => resolved.id, :new_status_id => feedback.id)
165 }
165 }
166
166
167 # Enumerations
167 # Enumerations
168 IssuePriority.create!(:name => l(:default_priority_low), :position => 1)
168 IssuePriority.create!(:name => l(:default_priority_low), :position => 1)
169 IssuePriority.create!(:name => l(:default_priority_normal), :position => 2, :is_default => true)
169 IssuePriority.create!(:name => l(:default_priority_normal), :position => 2, :is_default => true)
170 IssuePriority.create!(:name => l(:default_priority_high), :position => 3)
170 IssuePriority.create!(:name => l(:default_priority_high), :position => 3)
171 IssuePriority.create!(:name => l(:default_priority_urgent), :position => 4)
171 IssuePriority.create!(:name => l(:default_priority_urgent), :position => 4)
172 IssuePriority.create!(:name => l(:default_priority_immediate), :position => 5)
172 IssuePriority.create!(:name => l(:default_priority_immediate), :position => 5)
173
173
174 DocumentCategory.create!(:name => l(:default_doc_category_user), :position => 1)
174 DocumentCategory.create!(:name => l(:default_doc_category_user), :position => 1)
175 DocumentCategory.create!(:name => l(:default_doc_category_tech), :position => 2)
175 DocumentCategory.create!(:name => l(:default_doc_category_tech), :position => 2)
176
176
177 TimeEntryActivity.create!(:name => l(:default_activity_design), :position => 1)
177 TimeEntryActivity.create!(:name => l(:default_activity_design), :position => 1)
178 TimeEntryActivity.create!(:name => l(:default_activity_development), :position => 2)
178 TimeEntryActivity.create!(:name => l(:default_activity_development), :position => 2)
179 end
179 end
180 true
180 true
181 end
181 end
182 end
182 end
183 end
183 end
184 end
184 end
185 end
185 end
@@ -1,516 +1,516
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 desc 'Mantis migration script'
18 desc 'Mantis migration script'
19
19
20 require 'active_record'
20 require 'active_record'
21 require 'pp'
21 require 'pp'
22
22
23 namespace :redmine do
23 namespace :redmine do
24 task :migrate_from_mantis => :environment do
24 task :migrate_from_mantis => :environment do
25
25
26 module MantisMigrate
26 module MantisMigrate
27
27
28 DEFAULT_STATUS = IssueStatus.default
28 new_status = IssueStatus.find_by_position(1)
29 assigned_status = IssueStatus.find_by_position(2)
29 assigned_status = IssueStatus.find_by_position(2)
30 resolved_status = IssueStatus.find_by_position(3)
30 resolved_status = IssueStatus.find_by_position(3)
31 feedback_status = IssueStatus.find_by_position(4)
31 feedback_status = IssueStatus.find_by_position(4)
32 closed_status = IssueStatus.where(:is_closed => true).first
32 closed_status = IssueStatus.where(:is_closed => true).first
33 STATUS_MAPPING = {10 => DEFAULT_STATUS, # new
33 STATUS_MAPPING = {10 => new_status, # new
34 20 => feedback_status, # feedback
34 20 => feedback_status, # feedback
35 30 => DEFAULT_STATUS, # acknowledged
35 30 => new_status, # acknowledged
36 40 => DEFAULT_STATUS, # confirmed
36 40 => new_status, # confirmed
37 50 => assigned_status, # assigned
37 50 => assigned_status, # assigned
38 80 => resolved_status, # resolved
38 80 => resolved_status, # resolved
39 90 => closed_status # closed
39 90 => closed_status # closed
40 }
40 }
41
41
42 priorities = IssuePriority.all
42 priorities = IssuePriority.all
43 DEFAULT_PRIORITY = priorities[2]
43 DEFAULT_PRIORITY = priorities[2]
44 PRIORITY_MAPPING = {10 => priorities[1], # none
44 PRIORITY_MAPPING = {10 => priorities[1], # none
45 20 => priorities[1], # low
45 20 => priorities[1], # low
46 30 => priorities[2], # normal
46 30 => priorities[2], # normal
47 40 => priorities[3], # high
47 40 => priorities[3], # high
48 50 => priorities[4], # urgent
48 50 => priorities[4], # urgent
49 60 => priorities[5] # immediate
49 60 => priorities[5] # immediate
50 }
50 }
51
51
52 TRACKER_BUG = Tracker.find_by_position(1)
52 TRACKER_BUG = Tracker.find_by_position(1)
53 TRACKER_FEATURE = Tracker.find_by_position(2)
53 TRACKER_FEATURE = Tracker.find_by_position(2)
54
54
55 roles = Role.where(:builtin => 0).order('position ASC').all
55 roles = Role.where(:builtin => 0).order('position ASC').all
56 manager_role = roles[0]
56 manager_role = roles[0]
57 developer_role = roles[1]
57 developer_role = roles[1]
58 DEFAULT_ROLE = roles.last
58 DEFAULT_ROLE = roles.last
59 ROLE_MAPPING = {10 => DEFAULT_ROLE, # viewer
59 ROLE_MAPPING = {10 => DEFAULT_ROLE, # viewer
60 25 => DEFAULT_ROLE, # reporter
60 25 => DEFAULT_ROLE, # reporter
61 40 => DEFAULT_ROLE, # updater
61 40 => DEFAULT_ROLE, # updater
62 55 => developer_role, # developer
62 55 => developer_role, # developer
63 70 => manager_role, # manager
63 70 => manager_role, # manager
64 90 => manager_role # administrator
64 90 => manager_role # administrator
65 }
65 }
66
66
67 CUSTOM_FIELD_TYPE_MAPPING = {0 => 'string', # String
67 CUSTOM_FIELD_TYPE_MAPPING = {0 => 'string', # String
68 1 => 'int', # Numeric
68 1 => 'int', # Numeric
69 2 => 'int', # Float
69 2 => 'int', # Float
70 3 => 'list', # Enumeration
70 3 => 'list', # Enumeration
71 4 => 'string', # Email
71 4 => 'string', # Email
72 5 => 'bool', # Checkbox
72 5 => 'bool', # Checkbox
73 6 => 'list', # List
73 6 => 'list', # List
74 7 => 'list', # Multiselection list
74 7 => 'list', # Multiselection list
75 8 => 'date', # Date
75 8 => 'date', # Date
76 }
76 }
77
77
78 RELATION_TYPE_MAPPING = {1 => IssueRelation::TYPE_RELATES, # related to
78 RELATION_TYPE_MAPPING = {1 => IssueRelation::TYPE_RELATES, # related to
79 2 => IssueRelation::TYPE_RELATES, # parent of
79 2 => IssueRelation::TYPE_RELATES, # parent of
80 3 => IssueRelation::TYPE_RELATES, # child of
80 3 => IssueRelation::TYPE_RELATES, # child of
81 0 => IssueRelation::TYPE_DUPLICATES, # duplicate of
81 0 => IssueRelation::TYPE_DUPLICATES, # duplicate of
82 4 => IssueRelation::TYPE_DUPLICATES # has duplicate
82 4 => IssueRelation::TYPE_DUPLICATES # has duplicate
83 }
83 }
84
84
85 class MantisUser < ActiveRecord::Base
85 class MantisUser < ActiveRecord::Base
86 self.table_name = :mantis_user_table
86 self.table_name = :mantis_user_table
87
87
88 def firstname
88 def firstname
89 @firstname = realname.blank? ? username : realname.split.first[0..29]
89 @firstname = realname.blank? ? username : realname.split.first[0..29]
90 @firstname
90 @firstname
91 end
91 end
92
92
93 def lastname
93 def lastname
94 @lastname = realname.blank? ? '-' : realname.split[1..-1].join(' ')[0..29]
94 @lastname = realname.blank? ? '-' : realname.split[1..-1].join(' ')[0..29]
95 @lastname = '-' if @lastname.blank?
95 @lastname = '-' if @lastname.blank?
96 @lastname
96 @lastname
97 end
97 end
98
98
99 def email
99 def email
100 if read_attribute(:email).match(/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) &&
100 if read_attribute(:email).match(/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) &&
101 !User.find_by_mail(read_attribute(:email))
101 !User.find_by_mail(read_attribute(:email))
102 @email = read_attribute(:email)
102 @email = read_attribute(:email)
103 else
103 else
104 @email = "#{username}@foo.bar"
104 @email = "#{username}@foo.bar"
105 end
105 end
106 end
106 end
107
107
108 def username
108 def username
109 read_attribute(:username)[0..29].gsub(/[^a-zA-Z0-9_\-@\.]/, '-')
109 read_attribute(:username)[0..29].gsub(/[^a-zA-Z0-9_\-@\.]/, '-')
110 end
110 end
111 end
111 end
112
112
113 class MantisProject < ActiveRecord::Base
113 class MantisProject < ActiveRecord::Base
114 self.table_name = :mantis_project_table
114 self.table_name = :mantis_project_table
115 has_many :versions, :class_name => "MantisVersion", :foreign_key => :project_id
115 has_many :versions, :class_name => "MantisVersion", :foreign_key => :project_id
116 has_many :categories, :class_name => "MantisCategory", :foreign_key => :project_id
116 has_many :categories, :class_name => "MantisCategory", :foreign_key => :project_id
117 has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
117 has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
118 has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
118 has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
119
119
120 def identifier
120 def identifier
121 read_attribute(:name).downcase.gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)
121 read_attribute(:name).downcase.gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)
122 end
122 end
123 end
123 end
124
124
125 class MantisVersion < ActiveRecord::Base
125 class MantisVersion < ActiveRecord::Base
126 self.table_name = :mantis_project_version_table
126 self.table_name = :mantis_project_version_table
127
127
128 def version
128 def version
129 read_attribute(:version)[0..29]
129 read_attribute(:version)[0..29]
130 end
130 end
131
131
132 def description
132 def description
133 read_attribute(:description)[0..254]
133 read_attribute(:description)[0..254]
134 end
134 end
135 end
135 end
136
136
137 class MantisCategory < ActiveRecord::Base
137 class MantisCategory < ActiveRecord::Base
138 self.table_name = :mantis_project_category_table
138 self.table_name = :mantis_project_category_table
139 end
139 end
140
140
141 class MantisProjectUser < ActiveRecord::Base
141 class MantisProjectUser < ActiveRecord::Base
142 self.table_name = :mantis_project_user_list_table
142 self.table_name = :mantis_project_user_list_table
143 end
143 end
144
144
145 class MantisBug < ActiveRecord::Base
145 class MantisBug < ActiveRecord::Base
146 self.table_name = :mantis_bug_table
146 self.table_name = :mantis_bug_table
147 belongs_to :bug_text, :class_name => "MantisBugText", :foreign_key => :bug_text_id
147 belongs_to :bug_text, :class_name => "MantisBugText", :foreign_key => :bug_text_id
148 has_many :bug_notes, :class_name => "MantisBugNote", :foreign_key => :bug_id
148 has_many :bug_notes, :class_name => "MantisBugNote", :foreign_key => :bug_id
149 has_many :bug_files, :class_name => "MantisBugFile", :foreign_key => :bug_id
149 has_many :bug_files, :class_name => "MantisBugFile", :foreign_key => :bug_id
150 has_many :bug_monitors, :class_name => "MantisBugMonitor", :foreign_key => :bug_id
150 has_many :bug_monitors, :class_name => "MantisBugMonitor", :foreign_key => :bug_id
151 end
151 end
152
152
153 class MantisBugText < ActiveRecord::Base
153 class MantisBugText < ActiveRecord::Base
154 self.table_name = :mantis_bug_text_table
154 self.table_name = :mantis_bug_text_table
155
155
156 # Adds Mantis steps_to_reproduce and additional_information fields
156 # Adds Mantis steps_to_reproduce and additional_information fields
157 # to description if any
157 # to description if any
158 def full_description
158 def full_description
159 full_description = description
159 full_description = description
160 full_description += "\n\n*Steps to reproduce:*\n\n#{steps_to_reproduce}" unless steps_to_reproduce.blank?
160 full_description += "\n\n*Steps to reproduce:*\n\n#{steps_to_reproduce}" unless steps_to_reproduce.blank?
161 full_description += "\n\n*Additional information:*\n\n#{additional_information}" unless additional_information.blank?
161 full_description += "\n\n*Additional information:*\n\n#{additional_information}" unless additional_information.blank?
162 full_description
162 full_description
163 end
163 end
164 end
164 end
165
165
166 class MantisBugNote < ActiveRecord::Base
166 class MantisBugNote < ActiveRecord::Base
167 self.table_name = :mantis_bugnote_table
167 self.table_name = :mantis_bugnote_table
168 belongs_to :bug, :class_name => "MantisBug", :foreign_key => :bug_id
168 belongs_to :bug, :class_name => "MantisBug", :foreign_key => :bug_id
169 belongs_to :bug_note_text, :class_name => "MantisBugNoteText", :foreign_key => :bugnote_text_id
169 belongs_to :bug_note_text, :class_name => "MantisBugNoteText", :foreign_key => :bugnote_text_id
170 end
170 end
171
171
172 class MantisBugNoteText < ActiveRecord::Base
172 class MantisBugNoteText < ActiveRecord::Base
173 self.table_name = :mantis_bugnote_text_table
173 self.table_name = :mantis_bugnote_text_table
174 end
174 end
175
175
176 class MantisBugFile < ActiveRecord::Base
176 class MantisBugFile < ActiveRecord::Base
177 self.table_name = :mantis_bug_file_table
177 self.table_name = :mantis_bug_file_table
178
178
179 def size
179 def size
180 filesize
180 filesize
181 end
181 end
182
182
183 def original_filename
183 def original_filename
184 MantisMigrate.encode(filename)
184 MantisMigrate.encode(filename)
185 end
185 end
186
186
187 def content_type
187 def content_type
188 file_type
188 file_type
189 end
189 end
190
190
191 def read(*args)
191 def read(*args)
192 if @read_finished
192 if @read_finished
193 nil
193 nil
194 else
194 else
195 @read_finished = true
195 @read_finished = true
196 content
196 content
197 end
197 end
198 end
198 end
199 end
199 end
200
200
201 class MantisBugRelationship < ActiveRecord::Base
201 class MantisBugRelationship < ActiveRecord::Base
202 self.table_name = :mantis_bug_relationship_table
202 self.table_name = :mantis_bug_relationship_table
203 end
203 end
204
204
205 class MantisBugMonitor < ActiveRecord::Base
205 class MantisBugMonitor < ActiveRecord::Base
206 self.table_name = :mantis_bug_monitor_table
206 self.table_name = :mantis_bug_monitor_table
207 end
207 end
208
208
209 class MantisNews < ActiveRecord::Base
209 class MantisNews < ActiveRecord::Base
210 self.table_name = :mantis_news_table
210 self.table_name = :mantis_news_table
211 end
211 end
212
212
213 class MantisCustomField < ActiveRecord::Base
213 class MantisCustomField < ActiveRecord::Base
214 self.table_name = :mantis_custom_field_table
214 self.table_name = :mantis_custom_field_table
215 set_inheritance_column :none
215 set_inheritance_column :none
216 has_many :values, :class_name => "MantisCustomFieldString", :foreign_key => :field_id
216 has_many :values, :class_name => "MantisCustomFieldString", :foreign_key => :field_id
217 has_many :projects, :class_name => "MantisCustomFieldProject", :foreign_key => :field_id
217 has_many :projects, :class_name => "MantisCustomFieldProject", :foreign_key => :field_id
218
218
219 def format
219 def format
220 read_attribute :type
220 read_attribute :type
221 end
221 end
222
222
223 def name
223 def name
224 read_attribute(:name)[0..29]
224 read_attribute(:name)[0..29]
225 end
225 end
226 end
226 end
227
227
228 class MantisCustomFieldProject < ActiveRecord::Base
228 class MantisCustomFieldProject < ActiveRecord::Base
229 self.table_name = :mantis_custom_field_project_table
229 self.table_name = :mantis_custom_field_project_table
230 end
230 end
231
231
232 class MantisCustomFieldString < ActiveRecord::Base
232 class MantisCustomFieldString < ActiveRecord::Base
233 self.table_name = :mantis_custom_field_string_table
233 self.table_name = :mantis_custom_field_string_table
234 end
234 end
235
235
236 def self.migrate
236 def self.migrate
237
237
238 # Users
238 # Users
239 print "Migrating users"
239 print "Migrating users"
240 User.delete_all "login <> 'admin'"
240 User.delete_all "login <> 'admin'"
241 users_map = {}
241 users_map = {}
242 users_migrated = 0
242 users_migrated = 0
243 MantisUser.all.each do |user|
243 MantisUser.all.each do |user|
244 u = User.new :firstname => encode(user.firstname),
244 u = User.new :firstname => encode(user.firstname),
245 :lastname => encode(user.lastname),
245 :lastname => encode(user.lastname),
246 :mail => user.email,
246 :mail => user.email,
247 :last_login_on => user.last_visit
247 :last_login_on => user.last_visit
248 u.login = user.username
248 u.login = user.username
249 u.password = 'mantis'
249 u.password = 'mantis'
250 u.status = User::STATUS_LOCKED if user.enabled != 1
250 u.status = User::STATUS_LOCKED if user.enabled != 1
251 u.admin = true if user.access_level == 90
251 u.admin = true if user.access_level == 90
252 next unless u.save!
252 next unless u.save!
253 users_migrated += 1
253 users_migrated += 1
254 users_map[user.id] = u.id
254 users_map[user.id] = u.id
255 print '.'
255 print '.'
256 end
256 end
257 puts
257 puts
258
258
259 # Projects
259 # Projects
260 print "Migrating projects"
260 print "Migrating projects"
261 Project.destroy_all
261 Project.destroy_all
262 projects_map = {}
262 projects_map = {}
263 versions_map = {}
263 versions_map = {}
264 categories_map = {}
264 categories_map = {}
265 MantisProject.all.each do |project|
265 MantisProject.all.each do |project|
266 p = Project.new :name => encode(project.name),
266 p = Project.new :name => encode(project.name),
267 :description => encode(project.description)
267 :description => encode(project.description)
268 p.identifier = project.identifier
268 p.identifier = project.identifier
269 next unless p.save
269 next unless p.save
270 projects_map[project.id] = p.id
270 projects_map[project.id] = p.id
271 p.enabled_module_names = ['issue_tracking', 'news', 'wiki']
271 p.enabled_module_names = ['issue_tracking', 'news', 'wiki']
272 p.trackers << TRACKER_BUG unless p.trackers.include?(TRACKER_BUG)
272 p.trackers << TRACKER_BUG unless p.trackers.include?(TRACKER_BUG)
273 p.trackers << TRACKER_FEATURE unless p.trackers.include?(TRACKER_FEATURE)
273 p.trackers << TRACKER_FEATURE unless p.trackers.include?(TRACKER_FEATURE)
274 print '.'
274 print '.'
275
275
276 # Project members
276 # Project members
277 project.members.each do |member|
277 project.members.each do |member|
278 m = Member.new :user => User.find_by_id(users_map[member.user_id]),
278 m = Member.new :user => User.find_by_id(users_map[member.user_id]),
279 :roles => [ROLE_MAPPING[member.access_level] || DEFAULT_ROLE]
279 :roles => [ROLE_MAPPING[member.access_level] || DEFAULT_ROLE]
280 m.project = p
280 m.project = p
281 m.save
281 m.save
282 end
282 end
283
283
284 # Project versions
284 # Project versions
285 project.versions.each do |version|
285 project.versions.each do |version|
286 v = Version.new :name => encode(version.version),
286 v = Version.new :name => encode(version.version),
287 :description => encode(version.description),
287 :description => encode(version.description),
288 :effective_date => (version.date_order ? version.date_order.to_date : nil)
288 :effective_date => (version.date_order ? version.date_order.to_date : nil)
289 v.project = p
289 v.project = p
290 v.save
290 v.save
291 versions_map[version.id] = v.id
291 versions_map[version.id] = v.id
292 end
292 end
293
293
294 # Project categories
294 # Project categories
295 project.categories.each do |category|
295 project.categories.each do |category|
296 g = IssueCategory.new :name => category.category[0,30]
296 g = IssueCategory.new :name => category.category[0,30]
297 g.project = p
297 g.project = p
298 g.save
298 g.save
299 categories_map[category.category] = g.id
299 categories_map[category.category] = g.id
300 end
300 end
301 end
301 end
302 puts
302 puts
303
303
304 # Bugs
304 # Bugs
305 print "Migrating bugs"
305 print "Migrating bugs"
306 Issue.destroy_all
306 Issue.destroy_all
307 issues_map = {}
307 issues_map = {}
308 keep_bug_ids = (Issue.count == 0)
308 keep_bug_ids = (Issue.count == 0)
309 MantisBug.find_each(:batch_size => 200) do |bug|
309 MantisBug.find_each(:batch_size => 200) do |bug|
310 next unless projects_map[bug.project_id] && users_map[bug.reporter_id]
310 next unless projects_map[bug.project_id] && users_map[bug.reporter_id]
311 i = Issue.new :project_id => projects_map[bug.project_id],
311 i = Issue.new :project_id => projects_map[bug.project_id],
312 :subject => encode(bug.summary),
312 :subject => encode(bug.summary),
313 :description => encode(bug.bug_text.full_description),
313 :description => encode(bug.bug_text.full_description),
314 :priority => PRIORITY_MAPPING[bug.priority] || DEFAULT_PRIORITY,
314 :priority => PRIORITY_MAPPING[bug.priority] || DEFAULT_PRIORITY,
315 :created_on => bug.date_submitted,
315 :created_on => bug.date_submitted,
316 :updated_on => bug.last_updated
316 :updated_on => bug.last_updated
317 i.author = User.find_by_id(users_map[bug.reporter_id])
317 i.author = User.find_by_id(users_map[bug.reporter_id])
318 i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category[0,30]) unless bug.category.blank?
318 i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category[0,30]) unless bug.category.blank?
319 i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank?
319 i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank?
320 i.status = STATUS_MAPPING[bug.status] || DEFAULT_STATUS
321 i.tracker = (bug.severity == 10 ? TRACKER_FEATURE : TRACKER_BUG)
320 i.tracker = (bug.severity == 10 ? TRACKER_FEATURE : TRACKER_BUG)
321 i.status = STATUS_MAPPING[bug.status] || i.status
322 i.id = bug.id if keep_bug_ids
322 i.id = bug.id if keep_bug_ids
323 next unless i.save
323 next unless i.save
324 issues_map[bug.id] = i.id
324 issues_map[bug.id] = i.id
325 print '.'
325 print '.'
326 STDOUT.flush
326 STDOUT.flush
327
327
328 # Assignee
328 # Assignee
329 # Redmine checks that the assignee is a project member
329 # Redmine checks that the assignee is a project member
330 if (bug.handler_id && users_map[bug.handler_id])
330 if (bug.handler_id && users_map[bug.handler_id])
331 i.assigned_to = User.find_by_id(users_map[bug.handler_id])
331 i.assigned_to = User.find_by_id(users_map[bug.handler_id])
332 i.save(:validate => false)
332 i.save(:validate => false)
333 end
333 end
334
334
335 # Bug notes
335 # Bug notes
336 bug.bug_notes.each do |note|
336 bug.bug_notes.each do |note|
337 next unless users_map[note.reporter_id]
337 next unless users_map[note.reporter_id]
338 n = Journal.new :notes => encode(note.bug_note_text.note),
338 n = Journal.new :notes => encode(note.bug_note_text.note),
339 :created_on => note.date_submitted
339 :created_on => note.date_submitted
340 n.user = User.find_by_id(users_map[note.reporter_id])
340 n.user = User.find_by_id(users_map[note.reporter_id])
341 n.journalized = i
341 n.journalized = i
342 n.save
342 n.save
343 end
343 end
344
344
345 # Bug files
345 # Bug files
346 bug.bug_files.each do |file|
346 bug.bug_files.each do |file|
347 a = Attachment.new :created_on => file.date_added
347 a = Attachment.new :created_on => file.date_added
348 a.file = file
348 a.file = file
349 a.author = User.first
349 a.author = User.first
350 a.container = i
350 a.container = i
351 a.save
351 a.save
352 end
352 end
353
353
354 # Bug monitors
354 # Bug monitors
355 bug.bug_monitors.each do |monitor|
355 bug.bug_monitors.each do |monitor|
356 next unless users_map[monitor.user_id]
356 next unless users_map[monitor.user_id]
357 i.add_watcher(User.find_by_id(users_map[monitor.user_id]))
357 i.add_watcher(User.find_by_id(users_map[monitor.user_id]))
358 end
358 end
359 end
359 end
360
360
361 # update issue id sequence if needed (postgresql)
361 # update issue id sequence if needed (postgresql)
362 Issue.connection.reset_pk_sequence!(Issue.table_name) if Issue.connection.respond_to?('reset_pk_sequence!')
362 Issue.connection.reset_pk_sequence!(Issue.table_name) if Issue.connection.respond_to?('reset_pk_sequence!')
363 puts
363 puts
364
364
365 # Bug relationships
365 # Bug relationships
366 print "Migrating bug relations"
366 print "Migrating bug relations"
367 MantisBugRelationship.all.each do |relation|
367 MantisBugRelationship.all.each do |relation|
368 next unless issues_map[relation.source_bug_id] && issues_map[relation.destination_bug_id]
368 next unless issues_map[relation.source_bug_id] && issues_map[relation.destination_bug_id]
369 r = IssueRelation.new :relation_type => RELATION_TYPE_MAPPING[relation.relationship_type]
369 r = IssueRelation.new :relation_type => RELATION_TYPE_MAPPING[relation.relationship_type]
370 r.issue_from = Issue.find_by_id(issues_map[relation.source_bug_id])
370 r.issue_from = Issue.find_by_id(issues_map[relation.source_bug_id])
371 r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id])
371 r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id])
372 pp r unless r.save
372 pp r unless r.save
373 print '.'
373 print '.'
374 STDOUT.flush
374 STDOUT.flush
375 end
375 end
376 puts
376 puts
377
377
378 # News
378 # News
379 print "Migrating news"
379 print "Migrating news"
380 News.destroy_all
380 News.destroy_all
381 MantisNews.where('project_id > 0').all.each do |news|
381 MantisNews.where('project_id > 0').all.each do |news|
382 next unless projects_map[news.project_id]
382 next unless projects_map[news.project_id]
383 n = News.new :project_id => projects_map[news.project_id],
383 n = News.new :project_id => projects_map[news.project_id],
384 :title => encode(news.headline[0..59]),
384 :title => encode(news.headline[0..59]),
385 :description => encode(news.body),
385 :description => encode(news.body),
386 :created_on => news.date_posted
386 :created_on => news.date_posted
387 n.author = User.find_by_id(users_map[news.poster_id])
387 n.author = User.find_by_id(users_map[news.poster_id])
388 n.save
388 n.save
389 print '.'
389 print '.'
390 STDOUT.flush
390 STDOUT.flush
391 end
391 end
392 puts
392 puts
393
393
394 # Custom fields
394 # Custom fields
395 print "Migrating custom fields"
395 print "Migrating custom fields"
396 IssueCustomField.destroy_all
396 IssueCustomField.destroy_all
397 MantisCustomField.all.each do |field|
397 MantisCustomField.all.each do |field|
398 f = IssueCustomField.new :name => field.name[0..29],
398 f = IssueCustomField.new :name => field.name[0..29],
399 :field_format => CUSTOM_FIELD_TYPE_MAPPING[field.format],
399 :field_format => CUSTOM_FIELD_TYPE_MAPPING[field.format],
400 :min_length => field.length_min,
400 :min_length => field.length_min,
401 :max_length => field.length_max,
401 :max_length => field.length_max,
402 :regexp => field.valid_regexp,
402 :regexp => field.valid_regexp,
403 :possible_values => field.possible_values.split('|'),
403 :possible_values => field.possible_values.split('|'),
404 :is_required => field.require_report?
404 :is_required => field.require_report?
405 next unless f.save
405 next unless f.save
406 print '.'
406 print '.'
407 STDOUT.flush
407 STDOUT.flush
408 # Trackers association
408 # Trackers association
409 f.trackers = Tracker.all
409 f.trackers = Tracker.all
410
410
411 # Projects association
411 # Projects association
412 field.projects.each do |project|
412 field.projects.each do |project|
413 f.projects << Project.find_by_id(projects_map[project.project_id]) if projects_map[project.project_id]
413 f.projects << Project.find_by_id(projects_map[project.project_id]) if projects_map[project.project_id]
414 end
414 end
415
415
416 # Values
416 # Values
417 field.values.each do |value|
417 field.values.each do |value|
418 v = CustomValue.new :custom_field_id => f.id,
418 v = CustomValue.new :custom_field_id => f.id,
419 :value => value.value
419 :value => value.value
420 v.customized = Issue.find_by_id(issues_map[value.bug_id]) if issues_map[value.bug_id]
420 v.customized = Issue.find_by_id(issues_map[value.bug_id]) if issues_map[value.bug_id]
421 v.save
421 v.save
422 end unless f.new_record?
422 end unless f.new_record?
423 end
423 end
424 puts
424 puts
425
425
426 puts
426 puts
427 puts "Users: #{users_migrated}/#{MantisUser.count}"
427 puts "Users: #{users_migrated}/#{MantisUser.count}"
428 puts "Projects: #{Project.count}/#{MantisProject.count}"
428 puts "Projects: #{Project.count}/#{MantisProject.count}"
429 puts "Memberships: #{Member.count}/#{MantisProjectUser.count}"
429 puts "Memberships: #{Member.count}/#{MantisProjectUser.count}"
430 puts "Versions: #{Version.count}/#{MantisVersion.count}"
430 puts "Versions: #{Version.count}/#{MantisVersion.count}"
431 puts "Categories: #{IssueCategory.count}/#{MantisCategory.count}"
431 puts "Categories: #{IssueCategory.count}/#{MantisCategory.count}"
432 puts "Bugs: #{Issue.count}/#{MantisBug.count}"
432 puts "Bugs: #{Issue.count}/#{MantisBug.count}"
433 puts "Bug notes: #{Journal.count}/#{MantisBugNote.count}"
433 puts "Bug notes: #{Journal.count}/#{MantisBugNote.count}"
434 puts "Bug files: #{Attachment.count}/#{MantisBugFile.count}"
434 puts "Bug files: #{Attachment.count}/#{MantisBugFile.count}"
435 puts "Bug relations: #{IssueRelation.count}/#{MantisBugRelationship.count}"
435 puts "Bug relations: #{IssueRelation.count}/#{MantisBugRelationship.count}"
436 puts "Bug monitors: #{Watcher.count}/#{MantisBugMonitor.count}"
436 puts "Bug monitors: #{Watcher.count}/#{MantisBugMonitor.count}"
437 puts "News: #{News.count}/#{MantisNews.count}"
437 puts "News: #{News.count}/#{MantisNews.count}"
438 puts "Custom fields: #{IssueCustomField.count}/#{MantisCustomField.count}"
438 puts "Custom fields: #{IssueCustomField.count}/#{MantisCustomField.count}"
439 end
439 end
440
440
441 def self.encoding(charset)
441 def self.encoding(charset)
442 @charset = charset
442 @charset = charset
443 end
443 end
444
444
445 def self.establish_connection(params)
445 def self.establish_connection(params)
446 constants.each do |const|
446 constants.each do |const|
447 klass = const_get(const)
447 klass = const_get(const)
448 next unless klass.respond_to? 'establish_connection'
448 next unless klass.respond_to? 'establish_connection'
449 klass.establish_connection params
449 klass.establish_connection params
450 end
450 end
451 end
451 end
452
452
453 def self.encode(text)
453 def self.encode(text)
454 text.to_s.force_encoding(@charset).encode('UTF-8')
454 text.to_s.force_encoding(@charset).encode('UTF-8')
455 end
455 end
456 end
456 end
457
457
458 puts
458 puts
459 if Redmine::DefaultData::Loader.no_data?
459 if Redmine::DefaultData::Loader.no_data?
460 puts "Redmine configuration need to be loaded before importing data."
460 puts "Redmine configuration need to be loaded before importing data."
461 puts "Please, run this first:"
461 puts "Please, run this first:"
462 puts
462 puts
463 puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\""
463 puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\""
464 exit
464 exit
465 end
465 end
466
466
467 puts "WARNING: Your Redmine data will be deleted during this process."
467 puts "WARNING: Your Redmine data will be deleted during this process."
468 print "Are you sure you want to continue ? [y/N] "
468 print "Are you sure you want to continue ? [y/N] "
469 STDOUT.flush
469 STDOUT.flush
470 break unless STDIN.gets.match(/^y$/i)
470 break unless STDIN.gets.match(/^y$/i)
471
471
472 # Default Mantis database settings
472 # Default Mantis database settings
473 db_params = {:adapter => 'mysql2',
473 db_params = {:adapter => 'mysql2',
474 :database => 'bugtracker',
474 :database => 'bugtracker',
475 :host => 'localhost',
475 :host => 'localhost',
476 :username => 'root',
476 :username => 'root',
477 :password => '' }
477 :password => '' }
478
478
479 puts
479 puts
480 puts "Please enter settings for your Mantis database"
480 puts "Please enter settings for your Mantis database"
481 [:adapter, :host, :database, :username, :password].each do |param|
481 [:adapter, :host, :database, :username, :password].each do |param|
482 print "#{param} [#{db_params[param]}]: "
482 print "#{param} [#{db_params[param]}]: "
483 value = STDIN.gets.chomp!
483 value = STDIN.gets.chomp!
484 db_params[param] = value unless value.blank?
484 db_params[param] = value unless value.blank?
485 end
485 end
486
486
487 while true
487 while true
488 print "encoding [UTF-8]: "
488 print "encoding [UTF-8]: "
489 STDOUT.flush
489 STDOUT.flush
490 encoding = STDIN.gets.chomp!
490 encoding = STDIN.gets.chomp!
491 encoding = 'UTF-8' if encoding.blank?
491 encoding = 'UTF-8' if encoding.blank?
492 break if MantisMigrate.encoding encoding
492 break if MantisMigrate.encoding encoding
493 puts "Invalid encoding!"
493 puts "Invalid encoding!"
494 end
494 end
495 puts
495 puts
496
496
497 # Make sure bugs can refer bugs in other projects
497 # Make sure bugs can refer bugs in other projects
498 Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations'
498 Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations'
499
499
500 old_notified_events = Setting.notified_events
500 old_notified_events = Setting.notified_events
501 old_password_min_length = Setting.password_min_length
501 old_password_min_length = Setting.password_min_length
502 begin
502 begin
503 # Turn off email notifications temporarily
503 # Turn off email notifications temporarily
504 Setting.notified_events = []
504 Setting.notified_events = []
505 Setting.password_min_length = 4
505 Setting.password_min_length = 4
506 # Run the migration
506 # Run the migration
507 MantisMigrate.establish_connection db_params
507 MantisMigrate.establish_connection db_params
508 MantisMigrate.migrate
508 MantisMigrate.migrate
509 ensure
509 ensure
510 # Restore previous settings
510 # Restore previous settings
511 Setting.notified_events = old_notified_events
511 Setting.notified_events = old_notified_events
512 Setting.password_min_length = old_password_min_length
512 Setting.password_min_length = old_password_min_length
513 end
513 end
514
514
515 end
515 end
516 end
516 end
@@ -1,777 +1,777
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require 'active_record'
18 require 'active_record'
19 require 'pp'
19 require 'pp'
20
20
21 namespace :redmine do
21 namespace :redmine do
22 desc 'Trac migration script'
22 desc 'Trac migration script'
23 task :migrate_from_trac => :environment do
23 task :migrate_from_trac => :environment do
24
24
25 module TracMigrate
25 module TracMigrate
26 TICKET_MAP = []
26 TICKET_MAP = []
27
27
28 DEFAULT_STATUS = IssueStatus.default
28 new_status = IssueStatus.find_by_position(1)
29 assigned_status = IssueStatus.find_by_position(2)
29 assigned_status = IssueStatus.find_by_position(2)
30 resolved_status = IssueStatus.find_by_position(3)
30 resolved_status = IssueStatus.find_by_position(3)
31 feedback_status = IssueStatus.find_by_position(4)
31 feedback_status = IssueStatus.find_by_position(4)
32 closed_status = IssueStatus.where(:is_closed => true).first
32 closed_status = IssueStatus.where(:is_closed => true).first
33 STATUS_MAPPING = {'new' => DEFAULT_STATUS,
33 STATUS_MAPPING = {'new' => new_status,
34 'reopened' => feedback_status,
34 'reopened' => feedback_status,
35 'assigned' => assigned_status,
35 'assigned' => assigned_status,
36 'closed' => closed_status
36 'closed' => closed_status
37 }
37 }
38
38
39 priorities = IssuePriority.all
39 priorities = IssuePriority.all
40 DEFAULT_PRIORITY = priorities[0]
40 DEFAULT_PRIORITY = priorities[0]
41 PRIORITY_MAPPING = {'lowest' => priorities[0],
41 PRIORITY_MAPPING = {'lowest' => priorities[0],
42 'low' => priorities[0],
42 'low' => priorities[0],
43 'normal' => priorities[1],
43 'normal' => priorities[1],
44 'high' => priorities[2],
44 'high' => priorities[2],
45 'highest' => priorities[3],
45 'highest' => priorities[3],
46 # ---
46 # ---
47 'trivial' => priorities[0],
47 'trivial' => priorities[0],
48 'minor' => priorities[1],
48 'minor' => priorities[1],
49 'major' => priorities[2],
49 'major' => priorities[2],
50 'critical' => priorities[3],
50 'critical' => priorities[3],
51 'blocker' => priorities[4]
51 'blocker' => priorities[4]
52 }
52 }
53
53
54 TRACKER_BUG = Tracker.find_by_position(1)
54 TRACKER_BUG = Tracker.find_by_position(1)
55 TRACKER_FEATURE = Tracker.find_by_position(2)
55 TRACKER_FEATURE = Tracker.find_by_position(2)
56 DEFAULT_TRACKER = TRACKER_BUG
56 DEFAULT_TRACKER = TRACKER_BUG
57 TRACKER_MAPPING = {'defect' => TRACKER_BUG,
57 TRACKER_MAPPING = {'defect' => TRACKER_BUG,
58 'enhancement' => TRACKER_FEATURE,
58 'enhancement' => TRACKER_FEATURE,
59 'task' => TRACKER_FEATURE,
59 'task' => TRACKER_FEATURE,
60 'patch' =>TRACKER_FEATURE
60 'patch' =>TRACKER_FEATURE
61 }
61 }
62
62
63 roles = Role.where(:builtin => 0).order('position ASC').all
63 roles = Role.where(:builtin => 0).order('position ASC').all
64 manager_role = roles[0]
64 manager_role = roles[0]
65 developer_role = roles[1]
65 developer_role = roles[1]
66 DEFAULT_ROLE = roles.last
66 DEFAULT_ROLE = roles.last
67 ROLE_MAPPING = {'admin' => manager_role,
67 ROLE_MAPPING = {'admin' => manager_role,
68 'developer' => developer_role
68 'developer' => developer_role
69 }
69 }
70
70
71 class ::Time
71 class ::Time
72 class << self
72 class << self
73 alias :real_now :now
73 alias :real_now :now
74 def now
74 def now
75 real_now - @fake_diff.to_i
75 real_now - @fake_diff.to_i
76 end
76 end
77 def fake(time)
77 def fake(time)
78 @fake_diff = real_now - time
78 @fake_diff = real_now - time
79 res = yield
79 res = yield
80 @fake_diff = 0
80 @fake_diff = 0
81 res
81 res
82 end
82 end
83 end
83 end
84 end
84 end
85
85
86 class TracComponent < ActiveRecord::Base
86 class TracComponent < ActiveRecord::Base
87 self.table_name = :component
87 self.table_name = :component
88 end
88 end
89
89
90 class TracMilestone < ActiveRecord::Base
90 class TracMilestone < ActiveRecord::Base
91 self.table_name = :milestone
91 self.table_name = :milestone
92 # If this attribute is set a milestone has a defined target timepoint
92 # If this attribute is set a milestone has a defined target timepoint
93 def due
93 def due
94 if read_attribute(:due) && read_attribute(:due) > 0
94 if read_attribute(:due) && read_attribute(:due) > 0
95 Time.at(read_attribute(:due)).to_date
95 Time.at(read_attribute(:due)).to_date
96 else
96 else
97 nil
97 nil
98 end
98 end
99 end
99 end
100 # This is the real timepoint at which the milestone has finished.
100 # This is the real timepoint at which the milestone has finished.
101 def completed
101 def completed
102 if read_attribute(:completed) && read_attribute(:completed) > 0
102 if read_attribute(:completed) && read_attribute(:completed) > 0
103 Time.at(read_attribute(:completed)).to_date
103 Time.at(read_attribute(:completed)).to_date
104 else
104 else
105 nil
105 nil
106 end
106 end
107 end
107 end
108
108
109 def description
109 def description
110 # Attribute is named descr in Trac v0.8.x
110 # Attribute is named descr in Trac v0.8.x
111 has_attribute?(:descr) ? read_attribute(:descr) : read_attribute(:description)
111 has_attribute?(:descr) ? read_attribute(:descr) : read_attribute(:description)
112 end
112 end
113 end
113 end
114
114
115 class TracTicketCustom < ActiveRecord::Base
115 class TracTicketCustom < ActiveRecord::Base
116 self.table_name = :ticket_custom
116 self.table_name = :ticket_custom
117 end
117 end
118
118
119 class TracAttachment < ActiveRecord::Base
119 class TracAttachment < ActiveRecord::Base
120 self.table_name = :attachment
120 self.table_name = :attachment
121 set_inheritance_column :none
121 set_inheritance_column :none
122
122
123 def time; Time.at(read_attribute(:time)) end
123 def time; Time.at(read_attribute(:time)) end
124
124
125 def original_filename
125 def original_filename
126 filename
126 filename
127 end
127 end
128
128
129 def content_type
129 def content_type
130 ''
130 ''
131 end
131 end
132
132
133 def exist?
133 def exist?
134 File.file? trac_fullpath
134 File.file? trac_fullpath
135 end
135 end
136
136
137 def open
137 def open
138 File.open("#{trac_fullpath}", 'rb') {|f|
138 File.open("#{trac_fullpath}", 'rb') {|f|
139 @file = f
139 @file = f
140 yield self
140 yield self
141 }
141 }
142 end
142 end
143
143
144 def read(*args)
144 def read(*args)
145 @file.read(*args)
145 @file.read(*args)
146 end
146 end
147
147
148 def description
148 def description
149 read_attribute(:description).to_s.slice(0,255)
149 read_attribute(:description).to_s.slice(0,255)
150 end
150 end
151
151
152 private
152 private
153 def trac_fullpath
153 def trac_fullpath
154 attachment_type = read_attribute(:type)
154 attachment_type = read_attribute(:type)
155 #replace exotic characters with their hex representation to avoid invalid filenames
155 #replace exotic characters with their hex representation to avoid invalid filenames
156 trac_file = filename.gsub( /[^a-zA-Z0-9\-_\.!~*']/n ) do |x|
156 trac_file = filename.gsub( /[^a-zA-Z0-9\-_\.!~*']/n ) do |x|
157 codepoint = x.codepoints.to_a[0]
157 codepoint = x.codepoints.to_a[0]
158 sprintf('%%%02x', codepoint)
158 sprintf('%%%02x', codepoint)
159 end
159 end
160 "#{TracMigrate.trac_attachments_directory}/#{attachment_type}/#{id}/#{trac_file}"
160 "#{TracMigrate.trac_attachments_directory}/#{attachment_type}/#{id}/#{trac_file}"
161 end
161 end
162 end
162 end
163
163
164 class TracTicket < ActiveRecord::Base
164 class TracTicket < ActiveRecord::Base
165 self.table_name = :ticket
165 self.table_name = :ticket
166 set_inheritance_column :none
166 set_inheritance_column :none
167
167
168 # ticket changes: only migrate status changes and comments
168 # ticket changes: only migrate status changes and comments
169 has_many :ticket_changes, :class_name => "TracTicketChange", :foreign_key => :ticket
169 has_many :ticket_changes, :class_name => "TracTicketChange", :foreign_key => :ticket
170 has_many :customs, :class_name => "TracTicketCustom", :foreign_key => :ticket
170 has_many :customs, :class_name => "TracTicketCustom", :foreign_key => :ticket
171
171
172 def attachments
172 def attachments
173 TracMigrate::TracAttachment.all(:conditions => ["type = 'ticket' AND id = ?", self.id.to_s])
173 TracMigrate::TracAttachment.all(:conditions => ["type = 'ticket' AND id = ?", self.id.to_s])
174 end
174 end
175
175
176 def ticket_type
176 def ticket_type
177 read_attribute(:type)
177 read_attribute(:type)
178 end
178 end
179
179
180 def summary
180 def summary
181 read_attribute(:summary).blank? ? "(no subject)" : read_attribute(:summary)
181 read_attribute(:summary).blank? ? "(no subject)" : read_attribute(:summary)
182 end
182 end
183
183
184 def description
184 def description
185 read_attribute(:description).blank? ? summary : read_attribute(:description)
185 read_attribute(:description).blank? ? summary : read_attribute(:description)
186 end
186 end
187
187
188 def time; Time.at(read_attribute(:time)) end
188 def time; Time.at(read_attribute(:time)) end
189 def changetime; Time.at(read_attribute(:changetime)) end
189 def changetime; Time.at(read_attribute(:changetime)) end
190 end
190 end
191
191
192 class TracTicketChange < ActiveRecord::Base
192 class TracTicketChange < ActiveRecord::Base
193 self.table_name = :ticket_change
193 self.table_name = :ticket_change
194
194
195 def self.columns
195 def self.columns
196 # Hides Trac field 'field' to prevent clash with AR field_changed? method (Rails 3.0)
196 # Hides Trac field 'field' to prevent clash with AR field_changed? method (Rails 3.0)
197 super.select {|column| column.name.to_s != 'field'}
197 super.select {|column| column.name.to_s != 'field'}
198 end
198 end
199
199
200 def time; Time.at(read_attribute(:time)) end
200 def time; Time.at(read_attribute(:time)) end
201 end
201 end
202
202
203 TRAC_WIKI_PAGES = %w(InterMapTxt InterTrac InterWiki RecentChanges SandBox TracAccessibility TracAdmin TracBackup TracBrowser TracCgi TracChangeset \
203 TRAC_WIKI_PAGES = %w(InterMapTxt InterTrac InterWiki RecentChanges SandBox TracAccessibility TracAdmin TracBackup TracBrowser TracCgi TracChangeset \
204 TracEnvironment TracFastCgi TracGuide TracImport TracIni TracInstall TracInterfaceCustomization \
204 TracEnvironment TracFastCgi TracGuide TracImport TracIni TracInstall TracInterfaceCustomization \
205 TracLinks TracLogging TracModPython TracNotification TracPermissions TracPlugins TracQuery \
205 TracLinks TracLogging TracModPython TracNotification TracPermissions TracPlugins TracQuery \
206 TracReports TracRevisionLog TracRoadmap TracRss TracSearch TracStandalone TracSupport TracSyntaxColoring TracTickets \
206 TracReports TracRevisionLog TracRoadmap TracRss TracSearch TracStandalone TracSupport TracSyntaxColoring TracTickets \
207 TracTicketsCustomFields TracTimeline TracUnicode TracUpgrade TracWiki WikiDeletePage WikiFormatting \
207 TracTicketsCustomFields TracTimeline TracUnicode TracUpgrade TracWiki WikiDeletePage WikiFormatting \
208 WikiHtml WikiMacros WikiNewPage WikiPageNames WikiProcessors WikiRestructuredText WikiRestructuredTextLinks \
208 WikiHtml WikiMacros WikiNewPage WikiPageNames WikiProcessors WikiRestructuredText WikiRestructuredTextLinks \
209 CamelCase TitleIndex)
209 CamelCase TitleIndex)
210
210
211 class TracWikiPage < ActiveRecord::Base
211 class TracWikiPage < ActiveRecord::Base
212 self.table_name = :wiki
212 self.table_name = :wiki
213 set_primary_key :name
213 set_primary_key :name
214
214
215 def self.columns
215 def self.columns
216 # Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
216 # Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
217 super.select {|column| column.name.to_s != 'readonly'}
217 super.select {|column| column.name.to_s != 'readonly'}
218 end
218 end
219
219
220 def attachments
220 def attachments
221 TracMigrate::TracAttachment.all(:conditions => ["type = 'wiki' AND id = ?", self.id.to_s])
221 TracMigrate::TracAttachment.all(:conditions => ["type = 'wiki' AND id = ?", self.id.to_s])
222 end
222 end
223
223
224 def time; Time.at(read_attribute(:time)) end
224 def time; Time.at(read_attribute(:time)) end
225 end
225 end
226
226
227 class TracPermission < ActiveRecord::Base
227 class TracPermission < ActiveRecord::Base
228 self.table_name = :permission
228 self.table_name = :permission
229 end
229 end
230
230
231 class TracSessionAttribute < ActiveRecord::Base
231 class TracSessionAttribute < ActiveRecord::Base
232 self.table_name = :session_attribute
232 self.table_name = :session_attribute
233 end
233 end
234
234
235 def self.find_or_create_user(username, project_member = false)
235 def self.find_or_create_user(username, project_member = false)
236 return User.anonymous if username.blank?
236 return User.anonymous if username.blank?
237
237
238 u = User.find_by_login(username)
238 u = User.find_by_login(username)
239 if !u
239 if !u
240 # Create a new user if not found
240 # Create a new user if not found
241 mail = username[0, User::MAIL_LENGTH_LIMIT]
241 mail = username[0, User::MAIL_LENGTH_LIMIT]
242 if mail_attr = TracSessionAttribute.find_by_sid_and_name(username, 'email')
242 if mail_attr = TracSessionAttribute.find_by_sid_and_name(username, 'email')
243 mail = mail_attr.value
243 mail = mail_attr.value
244 end
244 end
245 mail = "#{mail}@foo.bar" unless mail.include?("@")
245 mail = "#{mail}@foo.bar" unless mail.include?("@")
246
246
247 name = username
247 name = username
248 if name_attr = TracSessionAttribute.find_by_sid_and_name(username, 'name')
248 if name_attr = TracSessionAttribute.find_by_sid_and_name(username, 'name')
249 name = name_attr.value
249 name = name_attr.value
250 end
250 end
251 name =~ (/(\w+)(\s+\w+)?/)
251 name =~ (/(\w+)(\s+\w+)?/)
252 fn = ($1 || "-").strip
252 fn = ($1 || "-").strip
253 ln = ($2 || '-').strip
253 ln = ($2 || '-').strip
254
254
255 u = User.new :mail => mail.gsub(/[^-@a-z0-9\.]/i, '-'),
255 u = User.new :mail => mail.gsub(/[^-@a-z0-9\.]/i, '-'),
256 :firstname => fn[0, limit_for(User, 'firstname')],
256 :firstname => fn[0, limit_for(User, 'firstname')],
257 :lastname => ln[0, limit_for(User, 'lastname')]
257 :lastname => ln[0, limit_for(User, 'lastname')]
258
258
259 u.login = username[0, User::LOGIN_LENGTH_LIMIT].gsub(/[^a-z0-9_\-@\.]/i, '-')
259 u.login = username[0, User::LOGIN_LENGTH_LIMIT].gsub(/[^a-z0-9_\-@\.]/i, '-')
260 u.password = 'trac'
260 u.password = 'trac'
261 u.admin = true if TracPermission.find_by_username_and_action(username, 'admin')
261 u.admin = true if TracPermission.find_by_username_and_action(username, 'admin')
262 # finally, a default user is used if the new user is not valid
262 # finally, a default user is used if the new user is not valid
263 u = User.first unless u.save
263 u = User.first unless u.save
264 end
264 end
265 # Make sure user is a member of the project
265 # Make sure user is a member of the project
266 if project_member && !u.member_of?(@target_project)
266 if project_member && !u.member_of?(@target_project)
267 role = DEFAULT_ROLE
267 role = DEFAULT_ROLE
268 if u.admin
268 if u.admin
269 role = ROLE_MAPPING['admin']
269 role = ROLE_MAPPING['admin']
270 elsif TracPermission.find_by_username_and_action(username, 'developer')
270 elsif TracPermission.find_by_username_and_action(username, 'developer')
271 role = ROLE_MAPPING['developer']
271 role = ROLE_MAPPING['developer']
272 end
272 end
273 Member.create(:user => u, :project => @target_project, :roles => [role])
273 Member.create(:user => u, :project => @target_project, :roles => [role])
274 u.reload
274 u.reload
275 end
275 end
276 u
276 u
277 end
277 end
278
278
279 # Basic wiki syntax conversion
279 # Basic wiki syntax conversion
280 def self.convert_wiki_text(text)
280 def self.convert_wiki_text(text)
281 # Titles
281 # Titles
282 text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
282 text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
283 # External Links
283 # External Links
284 text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
284 text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
285 # Ticket links:
285 # Ticket links:
286 # [ticket:234 Text],[ticket:234 This is a test]
286 # [ticket:234 Text],[ticket:234 This is a test]
287 text = text.gsub(/\[ticket\:([^\ ]+)\ (.+?)\]/, '"\2":/issues/show/\1')
287 text = text.gsub(/\[ticket\:([^\ ]+)\ (.+?)\]/, '"\2":/issues/show/\1')
288 # ticket:1234
288 # ticket:1234
289 # #1 is working cause Redmine uses the same syntax.
289 # #1 is working cause Redmine uses the same syntax.
290 text = text.gsub(/ticket\:([^\ ]+)/, '#\1')
290 text = text.gsub(/ticket\:([^\ ]+)/, '#\1')
291 # Milestone links:
291 # Milestone links:
292 # [milestone:"0.1.0 Mercury" Milestone 0.1.0 (Mercury)]
292 # [milestone:"0.1.0 Mercury" Milestone 0.1.0 (Mercury)]
293 # The text "Milestone 0.1.0 (Mercury)" is not converted,
293 # The text "Milestone 0.1.0 (Mercury)" is not converted,
294 # cause Redmine's wiki does not support this.
294 # cause Redmine's wiki does not support this.
295 text = text.gsub(/\[milestone\:\"([^\"]+)\"\ (.+?)\]/, 'version:"\1"')
295 text = text.gsub(/\[milestone\:\"([^\"]+)\"\ (.+?)\]/, 'version:"\1"')
296 # [milestone:"0.1.0 Mercury"]
296 # [milestone:"0.1.0 Mercury"]
297 text = text.gsub(/\[milestone\:\"([^\"]+)\"\]/, 'version:"\1"')
297 text = text.gsub(/\[milestone\:\"([^\"]+)\"\]/, 'version:"\1"')
298 text = text.gsub(/milestone\:\"([^\"]+)\"/, 'version:"\1"')
298 text = text.gsub(/milestone\:\"([^\"]+)\"/, 'version:"\1"')
299 # milestone:0.1.0
299 # milestone:0.1.0
300 text = text.gsub(/\[milestone\:([^\ ]+)\]/, 'version:\1')
300 text = text.gsub(/\[milestone\:([^\ ]+)\]/, 'version:\1')
301 text = text.gsub(/milestone\:([^\ ]+)/, 'version:\1')
301 text = text.gsub(/milestone\:([^\ ]+)/, 'version:\1')
302 # Internal Links
302 # Internal Links
303 text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
303 text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
304 text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
304 text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
305 text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
305 text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
306 text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
306 text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
307 text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
307 text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
308 text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
308 text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
309
309
310 # Links to pages UsingJustWikiCaps
310 # Links to pages UsingJustWikiCaps
311 text = text.gsub(/([^!]|^)(^| )([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '\\1\\2[[\3]]')
311 text = text.gsub(/([^!]|^)(^| )([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '\\1\\2[[\3]]')
312 # Normalize things that were supposed to not be links
312 # Normalize things that were supposed to not be links
313 # like !NotALink
313 # like !NotALink
314 text = text.gsub(/(^| )!([A-Z][A-Za-z]+)/, '\1\2')
314 text = text.gsub(/(^| )!([A-Z][A-Za-z]+)/, '\1\2')
315 # Revisions links
315 # Revisions links
316 text = text.gsub(/\[(\d+)\]/, 'r\1')
316 text = text.gsub(/\[(\d+)\]/, 'r\1')
317 # Ticket number re-writing
317 # Ticket number re-writing
318 text = text.gsub(/#(\d+)/) do |s|
318 text = text.gsub(/#(\d+)/) do |s|
319 if $1.length < 10
319 if $1.length < 10
320 # TICKET_MAP[$1.to_i] ||= $1
320 # TICKET_MAP[$1.to_i] ||= $1
321 "\##{TICKET_MAP[$1.to_i] || $1}"
321 "\##{TICKET_MAP[$1.to_i] || $1}"
322 else
322 else
323 s
323 s
324 end
324 end
325 end
325 end
326 # We would like to convert the Code highlighting too
326 # We would like to convert the Code highlighting too
327 # This will go into the next line.
327 # This will go into the next line.
328 shebang_line = false
328 shebang_line = false
329 # Regular expression for start of code
329 # Regular expression for start of code
330 pre_re = /\{\{\{/
330 pre_re = /\{\{\{/
331 # Code highlighting...
331 # Code highlighting...
332 shebang_re = /^\#\!([a-z]+)/
332 shebang_re = /^\#\!([a-z]+)/
333 # Regular expression for end of code
333 # Regular expression for end of code
334 pre_end_re = /\}\}\}/
334 pre_end_re = /\}\}\}/
335
335
336 # Go through the whole text..extract it line by line
336 # Go through the whole text..extract it line by line
337 text = text.gsub(/^(.*)$/) do |line|
337 text = text.gsub(/^(.*)$/) do |line|
338 m_pre = pre_re.match(line)
338 m_pre = pre_re.match(line)
339 if m_pre
339 if m_pre
340 line = '<pre>'
340 line = '<pre>'
341 else
341 else
342 m_sl = shebang_re.match(line)
342 m_sl = shebang_re.match(line)
343 if m_sl
343 if m_sl
344 shebang_line = true
344 shebang_line = true
345 line = '<code class="' + m_sl[1] + '">'
345 line = '<code class="' + m_sl[1] + '">'
346 end
346 end
347 m_pre_end = pre_end_re.match(line)
347 m_pre_end = pre_end_re.match(line)
348 if m_pre_end
348 if m_pre_end
349 line = '</pre>'
349 line = '</pre>'
350 if shebang_line
350 if shebang_line
351 line = '</code>' + line
351 line = '</code>' + line
352 end
352 end
353 end
353 end
354 end
354 end
355 line
355 line
356 end
356 end
357
357
358 # Highlighting
358 # Highlighting
359 text = text.gsub(/'''''([^\s])/, '_*\1')
359 text = text.gsub(/'''''([^\s])/, '_*\1')
360 text = text.gsub(/([^\s])'''''/, '\1*_')
360 text = text.gsub(/([^\s])'''''/, '\1*_')
361 text = text.gsub(/'''/, '*')
361 text = text.gsub(/'''/, '*')
362 text = text.gsub(/''/, '_')
362 text = text.gsub(/''/, '_')
363 text = text.gsub(/__/, '+')
363 text = text.gsub(/__/, '+')
364 text = text.gsub(/~~/, '-')
364 text = text.gsub(/~~/, '-')
365 text = text.gsub(/`/, '@')
365 text = text.gsub(/`/, '@')
366 text = text.gsub(/,,/, '~')
366 text = text.gsub(/,,/, '~')
367 # Lists
367 # Lists
368 text = text.gsub(/^([ ]+)\* /) {|s| '*' * $1.length + " "}
368 text = text.gsub(/^([ ]+)\* /) {|s| '*' * $1.length + " "}
369
369
370 text
370 text
371 end
371 end
372
372
373 def self.migrate
373 def self.migrate
374 establish_connection
374 establish_connection
375
375
376 # Quick database test
376 # Quick database test
377 TracComponent.count
377 TracComponent.count
378
378
379 migrated_components = 0
379 migrated_components = 0
380 migrated_milestones = 0
380 migrated_milestones = 0
381 migrated_tickets = 0
381 migrated_tickets = 0
382 migrated_custom_values = 0
382 migrated_custom_values = 0
383 migrated_ticket_attachments = 0
383 migrated_ticket_attachments = 0
384 migrated_wiki_edits = 0
384 migrated_wiki_edits = 0
385 migrated_wiki_attachments = 0
385 migrated_wiki_attachments = 0
386
386
387 #Wiki system initializing...
387 #Wiki system initializing...
388 @target_project.wiki.destroy if @target_project.wiki
388 @target_project.wiki.destroy if @target_project.wiki
389 @target_project.reload
389 @target_project.reload
390 wiki = Wiki.new(:project => @target_project, :start_page => 'WikiStart')
390 wiki = Wiki.new(:project => @target_project, :start_page => 'WikiStart')
391 wiki_edit_count = 0
391 wiki_edit_count = 0
392
392
393 # Components
393 # Components
394 print "Migrating components"
394 print "Migrating components"
395 issues_category_map = {}
395 issues_category_map = {}
396 TracComponent.all.each do |component|
396 TracComponent.all.each do |component|
397 print '.'
397 print '.'
398 STDOUT.flush
398 STDOUT.flush
399 c = IssueCategory.new :project => @target_project,
399 c = IssueCategory.new :project => @target_project,
400 :name => encode(component.name[0, limit_for(IssueCategory, 'name')])
400 :name => encode(component.name[0, limit_for(IssueCategory, 'name')])
401 next unless c.save
401 next unless c.save
402 issues_category_map[component.name] = c
402 issues_category_map[component.name] = c
403 migrated_components += 1
403 migrated_components += 1
404 end
404 end
405 puts
405 puts
406
406
407 # Milestones
407 # Milestones
408 print "Migrating milestones"
408 print "Migrating milestones"
409 version_map = {}
409 version_map = {}
410 TracMilestone.all.each do |milestone|
410 TracMilestone.all.each do |milestone|
411 print '.'
411 print '.'
412 STDOUT.flush
412 STDOUT.flush
413 # First we try to find the wiki page...
413 # First we try to find the wiki page...
414 p = wiki.find_or_new_page(milestone.name.to_s)
414 p = wiki.find_or_new_page(milestone.name.to_s)
415 p.content = WikiContent.new(:page => p) if p.new_record?
415 p.content = WikiContent.new(:page => p) if p.new_record?
416 p.content.text = milestone.description.to_s
416 p.content.text = milestone.description.to_s
417 p.content.author = find_or_create_user('trac')
417 p.content.author = find_or_create_user('trac')
418 p.content.comments = 'Milestone'
418 p.content.comments = 'Milestone'
419 p.save
419 p.save
420
420
421 v = Version.new :project => @target_project,
421 v = Version.new :project => @target_project,
422 :name => encode(milestone.name[0, limit_for(Version, 'name')]),
422 :name => encode(milestone.name[0, limit_for(Version, 'name')]),
423 :description => nil,
423 :description => nil,
424 :wiki_page_title => milestone.name.to_s,
424 :wiki_page_title => milestone.name.to_s,
425 :effective_date => milestone.completed
425 :effective_date => milestone.completed
426
426
427 next unless v.save
427 next unless v.save
428 version_map[milestone.name] = v
428 version_map[milestone.name] = v
429 migrated_milestones += 1
429 migrated_milestones += 1
430 end
430 end
431 puts
431 puts
432
432
433 # Custom fields
433 # Custom fields
434 # TODO: read trac.ini instead
434 # TODO: read trac.ini instead
435 print "Migrating custom fields"
435 print "Migrating custom fields"
436 custom_field_map = {}
436 custom_field_map = {}
437 TracTicketCustom.find_by_sql("SELECT DISTINCT name FROM #{TracTicketCustom.table_name}").each do |field|
437 TracTicketCustom.find_by_sql("SELECT DISTINCT name FROM #{TracTicketCustom.table_name}").each do |field|
438 print '.'
438 print '.'
439 STDOUT.flush
439 STDOUT.flush
440 # Redmine custom field name
440 # Redmine custom field name
441 field_name = encode(field.name[0, limit_for(IssueCustomField, 'name')]).humanize
441 field_name = encode(field.name[0, limit_for(IssueCustomField, 'name')]).humanize
442 # Find if the custom already exists in Redmine
442 # Find if the custom already exists in Redmine
443 f = IssueCustomField.find_by_name(field_name)
443 f = IssueCustomField.find_by_name(field_name)
444 # Or create a new one
444 # Or create a new one
445 f ||= IssueCustomField.create(:name => encode(field.name[0, limit_for(IssueCustomField, 'name')]).humanize,
445 f ||= IssueCustomField.create(:name => encode(field.name[0, limit_for(IssueCustomField, 'name')]).humanize,
446 :field_format => 'string')
446 :field_format => 'string')
447
447
448 next if f.new_record?
448 next if f.new_record?
449 f.trackers = Tracker.all
449 f.trackers = Tracker.all
450 f.projects << @target_project
450 f.projects << @target_project
451 custom_field_map[field.name] = f
451 custom_field_map[field.name] = f
452 end
452 end
453 puts
453 puts
454
454
455 # Trac 'resolution' field as a Redmine custom field
455 # Trac 'resolution' field as a Redmine custom field
456 r = IssueCustomField.where(:name => "Resolution").first
456 r = IssueCustomField.where(:name => "Resolution").first
457 r = IssueCustomField.new(:name => 'Resolution',
457 r = IssueCustomField.new(:name => 'Resolution',
458 :field_format => 'list',
458 :field_format => 'list',
459 :is_filter => true) if r.nil?
459 :is_filter => true) if r.nil?
460 r.trackers = Tracker.all
460 r.trackers = Tracker.all
461 r.projects << @target_project
461 r.projects << @target_project
462 r.possible_values = (r.possible_values + %w(fixed invalid wontfix duplicate worksforme)).flatten.compact.uniq
462 r.possible_values = (r.possible_values + %w(fixed invalid wontfix duplicate worksforme)).flatten.compact.uniq
463 r.save!
463 r.save!
464 custom_field_map['resolution'] = r
464 custom_field_map['resolution'] = r
465
465
466 # Tickets
466 # Tickets
467 print "Migrating tickets"
467 print "Migrating tickets"
468 TracTicket.find_each(:batch_size => 200) do |ticket|
468 TracTicket.find_each(:batch_size => 200) do |ticket|
469 print '.'
469 print '.'
470 STDOUT.flush
470 STDOUT.flush
471 i = Issue.new :project => @target_project,
471 i = Issue.new :project => @target_project,
472 :subject => encode(ticket.summary[0, limit_for(Issue, 'subject')]),
472 :subject => encode(ticket.summary[0, limit_for(Issue, 'subject')]),
473 :description => convert_wiki_text(encode(ticket.description)),
473 :description => convert_wiki_text(encode(ticket.description)),
474 :priority => PRIORITY_MAPPING[ticket.priority] || DEFAULT_PRIORITY,
474 :priority => PRIORITY_MAPPING[ticket.priority] || DEFAULT_PRIORITY,
475 :created_on => ticket.time
475 :created_on => ticket.time
476 i.author = find_or_create_user(ticket.reporter)
476 i.author = find_or_create_user(ticket.reporter)
477 i.category = issues_category_map[ticket.component] unless ticket.component.blank?
477 i.category = issues_category_map[ticket.component] unless ticket.component.blank?
478 i.fixed_version = version_map[ticket.milestone] unless ticket.milestone.blank?
478 i.fixed_version = version_map[ticket.milestone] unless ticket.milestone.blank?
479 i.status = STATUS_MAPPING[ticket.status] || DEFAULT_STATUS
480 i.tracker = TRACKER_MAPPING[ticket.ticket_type] || DEFAULT_TRACKER
479 i.tracker = TRACKER_MAPPING[ticket.ticket_type] || DEFAULT_TRACKER
480 i.status = STATUS_MAPPING[ticket.status] || i.default_status
481 i.id = ticket.id unless Issue.exists?(ticket.id)
481 i.id = ticket.id unless Issue.exists?(ticket.id)
482 next unless Time.fake(ticket.changetime) { i.save }
482 next unless Time.fake(ticket.changetime) { i.save }
483 TICKET_MAP[ticket.id] = i.id
483 TICKET_MAP[ticket.id] = i.id
484 migrated_tickets += 1
484 migrated_tickets += 1
485
485
486 # Owner
486 # Owner
487 unless ticket.owner.blank?
487 unless ticket.owner.blank?
488 i.assigned_to = find_or_create_user(ticket.owner, true)
488 i.assigned_to = find_or_create_user(ticket.owner, true)
489 Time.fake(ticket.changetime) { i.save }
489 Time.fake(ticket.changetime) { i.save }
490 end
490 end
491
491
492 # Comments and status/resolution changes
492 # Comments and status/resolution changes
493 ticket.ticket_changes.group_by(&:time).each do |time, changeset|
493 ticket.ticket_changes.group_by(&:time).each do |time, changeset|
494 status_change = changeset.select {|change| change.field == 'status'}.first
494 status_change = changeset.select {|change| change.field == 'status'}.first
495 resolution_change = changeset.select {|change| change.field == 'resolution'}.first
495 resolution_change = changeset.select {|change| change.field == 'resolution'}.first
496 comment_change = changeset.select {|change| change.field == 'comment'}.first
496 comment_change = changeset.select {|change| change.field == 'comment'}.first
497
497
498 n = Journal.new :notes => (comment_change ? convert_wiki_text(encode(comment_change.newvalue)) : ''),
498 n = Journal.new :notes => (comment_change ? convert_wiki_text(encode(comment_change.newvalue)) : ''),
499 :created_on => time
499 :created_on => time
500 n.user = find_or_create_user(changeset.first.author)
500 n.user = find_or_create_user(changeset.first.author)
501 n.journalized = i
501 n.journalized = i
502 if status_change &&
502 if status_change &&
503 STATUS_MAPPING[status_change.oldvalue] &&
503 STATUS_MAPPING[status_change.oldvalue] &&
504 STATUS_MAPPING[status_change.newvalue] &&
504 STATUS_MAPPING[status_change.newvalue] &&
505 (STATUS_MAPPING[status_change.oldvalue] != STATUS_MAPPING[status_change.newvalue])
505 (STATUS_MAPPING[status_change.oldvalue] != STATUS_MAPPING[status_change.newvalue])
506 n.details << JournalDetail.new(:property => 'attr',
506 n.details << JournalDetail.new(:property => 'attr',
507 :prop_key => 'status_id',
507 :prop_key => 'status_id',
508 :old_value => STATUS_MAPPING[status_change.oldvalue].id,
508 :old_value => STATUS_MAPPING[status_change.oldvalue].id,
509 :value => STATUS_MAPPING[status_change.newvalue].id)
509 :value => STATUS_MAPPING[status_change.newvalue].id)
510 end
510 end
511 if resolution_change
511 if resolution_change
512 n.details << JournalDetail.new(:property => 'cf',
512 n.details << JournalDetail.new(:property => 'cf',
513 :prop_key => custom_field_map['resolution'].id,
513 :prop_key => custom_field_map['resolution'].id,
514 :old_value => resolution_change.oldvalue,
514 :old_value => resolution_change.oldvalue,
515 :value => resolution_change.newvalue)
515 :value => resolution_change.newvalue)
516 end
516 end
517 n.save unless n.details.empty? && n.notes.blank?
517 n.save unless n.details.empty? && n.notes.blank?
518 end
518 end
519
519
520 # Attachments
520 # Attachments
521 ticket.attachments.each do |attachment|
521 ticket.attachments.each do |attachment|
522 next unless attachment.exist?
522 next unless attachment.exist?
523 attachment.open {
523 attachment.open {
524 a = Attachment.new :created_on => attachment.time
524 a = Attachment.new :created_on => attachment.time
525 a.file = attachment
525 a.file = attachment
526 a.author = find_or_create_user(attachment.author)
526 a.author = find_or_create_user(attachment.author)
527 a.container = i
527 a.container = i
528 a.description = attachment.description
528 a.description = attachment.description
529 migrated_ticket_attachments += 1 if a.save
529 migrated_ticket_attachments += 1 if a.save
530 }
530 }
531 end
531 end
532
532
533 # Custom fields
533 # Custom fields
534 custom_values = ticket.customs.inject({}) do |h, custom|
534 custom_values = ticket.customs.inject({}) do |h, custom|
535 if custom_field = custom_field_map[custom.name]
535 if custom_field = custom_field_map[custom.name]
536 h[custom_field.id] = custom.value
536 h[custom_field.id] = custom.value
537 migrated_custom_values += 1
537 migrated_custom_values += 1
538 end
538 end
539 h
539 h
540 end
540 end
541 if custom_field_map['resolution'] && !ticket.resolution.blank?
541 if custom_field_map['resolution'] && !ticket.resolution.blank?
542 custom_values[custom_field_map['resolution'].id] = ticket.resolution
542 custom_values[custom_field_map['resolution'].id] = ticket.resolution
543 end
543 end
544 i.custom_field_values = custom_values
544 i.custom_field_values = custom_values
545 i.save_custom_field_values
545 i.save_custom_field_values
546 end
546 end
547
547
548 # update issue id sequence if needed (postgresql)
548 # update issue id sequence if needed (postgresql)
549 Issue.connection.reset_pk_sequence!(Issue.table_name) if Issue.connection.respond_to?('reset_pk_sequence!')
549 Issue.connection.reset_pk_sequence!(Issue.table_name) if Issue.connection.respond_to?('reset_pk_sequence!')
550 puts
550 puts
551
551
552 # Wiki
552 # Wiki
553 print "Migrating wiki"
553 print "Migrating wiki"
554 if wiki.save
554 if wiki.save
555 TracWikiPage.order('name, version').all.each do |page|
555 TracWikiPage.order('name, version').all.each do |page|
556 # Do not migrate Trac manual wiki pages
556 # Do not migrate Trac manual wiki pages
557 next if TRAC_WIKI_PAGES.include?(page.name)
557 next if TRAC_WIKI_PAGES.include?(page.name)
558 wiki_edit_count += 1
558 wiki_edit_count += 1
559 print '.'
559 print '.'
560 STDOUT.flush
560 STDOUT.flush
561 p = wiki.find_or_new_page(page.name)
561 p = wiki.find_or_new_page(page.name)
562 p.content = WikiContent.new(:page => p) if p.new_record?
562 p.content = WikiContent.new(:page => p) if p.new_record?
563 p.content.text = page.text
563 p.content.text = page.text
564 p.content.author = find_or_create_user(page.author) unless page.author.blank? || page.author == 'trac'
564 p.content.author = find_or_create_user(page.author) unless page.author.blank? || page.author == 'trac'
565 p.content.comments = page.comment
565 p.content.comments = page.comment
566 Time.fake(page.time) { p.new_record? ? p.save : p.content.save }
566 Time.fake(page.time) { p.new_record? ? p.save : p.content.save }
567
567
568 next if p.content.new_record?
568 next if p.content.new_record?
569 migrated_wiki_edits += 1
569 migrated_wiki_edits += 1
570
570
571 # Attachments
571 # Attachments
572 page.attachments.each do |attachment|
572 page.attachments.each do |attachment|
573 next unless attachment.exist?
573 next unless attachment.exist?
574 next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
574 next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
575 attachment.open {
575 attachment.open {
576 a = Attachment.new :created_on => attachment.time
576 a = Attachment.new :created_on => attachment.time
577 a.file = attachment
577 a.file = attachment
578 a.author = find_or_create_user(attachment.author)
578 a.author = find_or_create_user(attachment.author)
579 a.description = attachment.description
579 a.description = attachment.description
580 a.container = p
580 a.container = p
581 migrated_wiki_attachments += 1 if a.save
581 migrated_wiki_attachments += 1 if a.save
582 }
582 }
583 end
583 end
584 end
584 end
585
585
586 wiki.reload
586 wiki.reload
587 wiki.pages.each do |page|
587 wiki.pages.each do |page|
588 page.content.text = convert_wiki_text(page.content.text)
588 page.content.text = convert_wiki_text(page.content.text)
589 Time.fake(page.content.updated_on) { page.content.save }
589 Time.fake(page.content.updated_on) { page.content.save }
590 end
590 end
591 end
591 end
592 puts
592 puts
593
593
594 puts
594 puts
595 puts "Components: #{migrated_components}/#{TracComponent.count}"
595 puts "Components: #{migrated_components}/#{TracComponent.count}"
596 puts "Milestones: #{migrated_milestones}/#{TracMilestone.count}"
596 puts "Milestones: #{migrated_milestones}/#{TracMilestone.count}"
597 puts "Tickets: #{migrated_tickets}/#{TracTicket.count}"
597 puts "Tickets: #{migrated_tickets}/#{TracTicket.count}"
598 puts "Ticket files: #{migrated_ticket_attachments}/" + TracAttachment.count(:conditions => {:type => 'ticket'}).to_s
598 puts "Ticket files: #{migrated_ticket_attachments}/" + TracAttachment.count(:conditions => {:type => 'ticket'}).to_s
599 puts "Custom values: #{migrated_custom_values}/#{TracTicketCustom.count}"
599 puts "Custom values: #{migrated_custom_values}/#{TracTicketCustom.count}"
600 puts "Wiki edits: #{migrated_wiki_edits}/#{wiki_edit_count}"
600 puts "Wiki edits: #{migrated_wiki_edits}/#{wiki_edit_count}"
601 puts "Wiki files: #{migrated_wiki_attachments}/" + TracAttachment.count(:conditions => {:type => 'wiki'}).to_s
601 puts "Wiki files: #{migrated_wiki_attachments}/" + TracAttachment.count(:conditions => {:type => 'wiki'}).to_s
602 end
602 end
603
603
604 def self.limit_for(klass, attribute)
604 def self.limit_for(klass, attribute)
605 klass.columns_hash[attribute.to_s].limit
605 klass.columns_hash[attribute.to_s].limit
606 end
606 end
607
607
608 def self.encoding(charset)
608 def self.encoding(charset)
609 @charset = charset
609 @charset = charset
610 end
610 end
611
611
612 def self.set_trac_directory(path)
612 def self.set_trac_directory(path)
613 @@trac_directory = path
613 @@trac_directory = path
614 raise "This directory doesn't exist!" unless File.directory?(path)
614 raise "This directory doesn't exist!" unless File.directory?(path)
615 raise "#{trac_attachments_directory} doesn't exist!" unless File.directory?(trac_attachments_directory)
615 raise "#{trac_attachments_directory} doesn't exist!" unless File.directory?(trac_attachments_directory)
616 @@trac_directory
616 @@trac_directory
617 rescue Exception => e
617 rescue Exception => e
618 puts e
618 puts e
619 return false
619 return false
620 end
620 end
621
621
622 def self.trac_directory
622 def self.trac_directory
623 @@trac_directory
623 @@trac_directory
624 end
624 end
625
625
626 def self.set_trac_adapter(adapter)
626 def self.set_trac_adapter(adapter)
627 return false if adapter.blank?
627 return false if adapter.blank?
628 raise "Unknown adapter: #{adapter}!" unless %w(sqlite3 mysql postgresql).include?(adapter)
628 raise "Unknown adapter: #{adapter}!" unless %w(sqlite3 mysql postgresql).include?(adapter)
629 # If adapter is sqlite or sqlite3, make sure that trac.db exists
629 # If adapter is sqlite or sqlite3, make sure that trac.db exists
630 raise "#{trac_db_path} doesn't exist!" if %w(sqlite3).include?(adapter) && !File.exist?(trac_db_path)
630 raise "#{trac_db_path} doesn't exist!" if %w(sqlite3).include?(adapter) && !File.exist?(trac_db_path)
631 @@trac_adapter = adapter
631 @@trac_adapter = adapter
632 rescue Exception => e
632 rescue Exception => e
633 puts e
633 puts e
634 return false
634 return false
635 end
635 end
636
636
637 def self.set_trac_db_host(host)
637 def self.set_trac_db_host(host)
638 return nil if host.blank?
638 return nil if host.blank?
639 @@trac_db_host = host
639 @@trac_db_host = host
640 end
640 end
641
641
642 def self.set_trac_db_port(port)
642 def self.set_trac_db_port(port)
643 return nil if port.to_i == 0
643 return nil if port.to_i == 0
644 @@trac_db_port = port.to_i
644 @@trac_db_port = port.to_i
645 end
645 end
646
646
647 def self.set_trac_db_name(name)
647 def self.set_trac_db_name(name)
648 return nil if name.blank?
648 return nil if name.blank?
649 @@trac_db_name = name
649 @@trac_db_name = name
650 end
650 end
651
651
652 def self.set_trac_db_username(username)
652 def self.set_trac_db_username(username)
653 @@trac_db_username = username
653 @@trac_db_username = username
654 end
654 end
655
655
656 def self.set_trac_db_password(password)
656 def self.set_trac_db_password(password)
657 @@trac_db_password = password
657 @@trac_db_password = password
658 end
658 end
659
659
660 def self.set_trac_db_schema(schema)
660 def self.set_trac_db_schema(schema)
661 @@trac_db_schema = schema
661 @@trac_db_schema = schema
662 end
662 end
663
663
664 mattr_reader :trac_directory, :trac_adapter, :trac_db_host, :trac_db_port, :trac_db_name, :trac_db_schema, :trac_db_username, :trac_db_password
664 mattr_reader :trac_directory, :trac_adapter, :trac_db_host, :trac_db_port, :trac_db_name, :trac_db_schema, :trac_db_username, :trac_db_password
665
665
666 def self.trac_db_path; "#{trac_directory}/db/trac.db" end
666 def self.trac_db_path; "#{trac_directory}/db/trac.db" end
667 def self.trac_attachments_directory; "#{trac_directory}/attachments" end
667 def self.trac_attachments_directory; "#{trac_directory}/attachments" end
668
668
669 def self.target_project_identifier(identifier)
669 def self.target_project_identifier(identifier)
670 project = Project.find_by_identifier(identifier)
670 project = Project.find_by_identifier(identifier)
671 if !project
671 if !project
672 # create the target project
672 # create the target project
673 project = Project.new :name => identifier.humanize,
673 project = Project.new :name => identifier.humanize,
674 :description => ''
674 :description => ''
675 project.identifier = identifier
675 project.identifier = identifier
676 puts "Unable to create a project with identifier '#{identifier}'!" unless project.save
676 puts "Unable to create a project with identifier '#{identifier}'!" unless project.save
677 # enable issues and wiki for the created project
677 # enable issues and wiki for the created project
678 project.enabled_module_names = ['issue_tracking', 'wiki']
678 project.enabled_module_names = ['issue_tracking', 'wiki']
679 else
679 else
680 puts
680 puts
681 puts "This project already exists in your Redmine database."
681 puts "This project already exists in your Redmine database."
682 print "Are you sure you want to append data to this project ? [Y/n] "
682 print "Are you sure you want to append data to this project ? [Y/n] "
683 STDOUT.flush
683 STDOUT.flush
684 exit if STDIN.gets.match(/^n$/i)
684 exit if STDIN.gets.match(/^n$/i)
685 end
685 end
686 project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG)
686 project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG)
687 project.trackers << TRACKER_FEATURE unless project.trackers.include?(TRACKER_FEATURE)
687 project.trackers << TRACKER_FEATURE unless project.trackers.include?(TRACKER_FEATURE)
688 @target_project = project.new_record? ? nil : project
688 @target_project = project.new_record? ? nil : project
689 @target_project.reload
689 @target_project.reload
690 end
690 end
691
691
692 def self.connection_params
692 def self.connection_params
693 if trac_adapter == 'sqlite3'
693 if trac_adapter == 'sqlite3'
694 {:adapter => 'sqlite3',
694 {:adapter => 'sqlite3',
695 :database => trac_db_path}
695 :database => trac_db_path}
696 else
696 else
697 {:adapter => trac_adapter,
697 {:adapter => trac_adapter,
698 :database => trac_db_name,
698 :database => trac_db_name,
699 :host => trac_db_host,
699 :host => trac_db_host,
700 :port => trac_db_port,
700 :port => trac_db_port,
701 :username => trac_db_username,
701 :username => trac_db_username,
702 :password => trac_db_password,
702 :password => trac_db_password,
703 :schema_search_path => trac_db_schema
703 :schema_search_path => trac_db_schema
704 }
704 }
705 end
705 end
706 end
706 end
707
707
708 def self.establish_connection
708 def self.establish_connection
709 constants.each do |const|
709 constants.each do |const|
710 klass = const_get(const)
710 klass = const_get(const)
711 next unless klass.respond_to? 'establish_connection'
711 next unless klass.respond_to? 'establish_connection'
712 klass.establish_connection connection_params
712 klass.establish_connection connection_params
713 end
713 end
714 end
714 end
715
715
716 def self.encode(text)
716 def self.encode(text)
717 text.to_s.force_encoding(@charset).encode('UTF-8')
717 text.to_s.force_encoding(@charset).encode('UTF-8')
718 end
718 end
719 end
719 end
720
720
721 puts
721 puts
722 if Redmine::DefaultData::Loader.no_data?
722 if Redmine::DefaultData::Loader.no_data?
723 puts "Redmine configuration need to be loaded before importing data."
723 puts "Redmine configuration need to be loaded before importing data."
724 puts "Please, run this first:"
724 puts "Please, run this first:"
725 puts
725 puts
726 puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\""
726 puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\""
727 exit
727 exit
728 end
728 end
729
729
730 puts "WARNING: a new project will be added to Redmine during this process."
730 puts "WARNING: a new project will be added to Redmine during this process."
731 print "Are you sure you want to continue ? [y/N] "
731 print "Are you sure you want to continue ? [y/N] "
732 STDOUT.flush
732 STDOUT.flush
733 break unless STDIN.gets.match(/^y$/i)
733 break unless STDIN.gets.match(/^y$/i)
734 puts
734 puts
735
735
736 def prompt(text, options = {}, &block)
736 def prompt(text, options = {}, &block)
737 default = options[:default] || ''
737 default = options[:default] || ''
738 while true
738 while true
739 print "#{text} [#{default}]: "
739 print "#{text} [#{default}]: "
740 STDOUT.flush
740 STDOUT.flush
741 value = STDIN.gets.chomp!
741 value = STDIN.gets.chomp!
742 value = default if value.blank?
742 value = default if value.blank?
743 break if yield value
743 break if yield value
744 end
744 end
745 end
745 end
746
746
747 DEFAULT_PORTS = {'mysql' => 3306, 'postgresql' => 5432}
747 DEFAULT_PORTS = {'mysql' => 3306, 'postgresql' => 5432}
748
748
749 prompt('Trac directory') {|directory| TracMigrate.set_trac_directory directory.strip}
749 prompt('Trac directory') {|directory| TracMigrate.set_trac_directory directory.strip}
750 prompt('Trac database adapter (sqlite3, mysql2, postgresql)', :default => 'sqlite3') {|adapter| TracMigrate.set_trac_adapter adapter}
750 prompt('Trac database adapter (sqlite3, mysql2, postgresql)', :default => 'sqlite3') {|adapter| TracMigrate.set_trac_adapter adapter}
751 unless %w(sqlite3).include?(TracMigrate.trac_adapter)
751 unless %w(sqlite3).include?(TracMigrate.trac_adapter)
752 prompt('Trac database host', :default => 'localhost') {|host| TracMigrate.set_trac_db_host host}
752 prompt('Trac database host', :default => 'localhost') {|host| TracMigrate.set_trac_db_host host}
753 prompt('Trac database port', :default => DEFAULT_PORTS[TracMigrate.trac_adapter]) {|port| TracMigrate.set_trac_db_port port}
753 prompt('Trac database port', :default => DEFAULT_PORTS[TracMigrate.trac_adapter]) {|port| TracMigrate.set_trac_db_port port}
754 prompt('Trac database name') {|name| TracMigrate.set_trac_db_name name}
754 prompt('Trac database name') {|name| TracMigrate.set_trac_db_name name}
755 prompt('Trac database schema', :default => 'public') {|schema| TracMigrate.set_trac_db_schema schema}
755 prompt('Trac database schema', :default => 'public') {|schema| TracMigrate.set_trac_db_schema schema}
756 prompt('Trac database username') {|username| TracMigrate.set_trac_db_username username}
756 prompt('Trac database username') {|username| TracMigrate.set_trac_db_username username}
757 prompt('Trac database password') {|password| TracMigrate.set_trac_db_password password}
757 prompt('Trac database password') {|password| TracMigrate.set_trac_db_password password}
758 end
758 end
759 prompt('Trac database encoding', :default => 'UTF-8') {|encoding| TracMigrate.encoding encoding}
759 prompt('Trac database encoding', :default => 'UTF-8') {|encoding| TracMigrate.encoding encoding}
760 prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier}
760 prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier}
761 puts
761 puts
762
762
763 old_notified_events = Setting.notified_events
763 old_notified_events = Setting.notified_events
764 old_password_min_length = Setting.password_min_length
764 old_password_min_length = Setting.password_min_length
765 begin
765 begin
766 # Turn off email notifications temporarily
766 # Turn off email notifications temporarily
767 Setting.notified_events = []
767 Setting.notified_events = []
768 Setting.password_min_length = 4
768 Setting.password_min_length = 4
769 # Run the migration
769 # Run the migration
770 TracMigrate.migrate
770 TracMigrate.migrate
771 ensure
771 ensure
772 # Restore previous settings
772 # Restore previous settings
773 Setting.notified_events = old_notified_events
773 Setting.notified_events = old_notified_events
774 Setting.password_min_length = old_password_min_length
774 Setting.password_min_length = old_password_min_length
775 end
775 end
776 end
776 end
777 end
777 end
@@ -1,37 +1,31
1 ---
1 ---
2 issue_statuses_001:
2 issue_statuses_001:
3 id: 1
3 id: 1
4 name: New
4 name: New
5 is_default: true
6 is_closed: false
5 is_closed: false
7 position: 1
6 position: 1
8 issue_statuses_002:
7 issue_statuses_002:
9 id: 2
8 id: 2
10 name: Assigned
9 name: Assigned
11 is_default: false
12 is_closed: false
10 is_closed: false
13 position: 2
11 position: 2
14 issue_statuses_003:
12 issue_statuses_003:
15 id: 3
13 id: 3
16 name: Resolved
14 name: Resolved
17 is_default: false
18 is_closed: false
15 is_closed: false
19 position: 3
16 position: 3
20 issue_statuses_004:
17 issue_statuses_004:
21 name: Feedback
18 name: Feedback
22 id: 4
19 id: 4
23 is_default: false
24 is_closed: false
20 is_closed: false
25 position: 4
21 position: 4
26 issue_statuses_005:
22 issue_statuses_005:
27 id: 5
23 id: 5
28 name: Closed
24 name: Closed
29 is_default: false
30 is_closed: true
25 is_closed: true
31 position: 5
26 position: 5
32 issue_statuses_006:
27 issue_statuses_006:
33 id: 6
28 id: 6
34 name: Rejected
29 name: Rejected
35 is_default: false
36 is_closed: true
30 is_closed: true
37 position: 6
31 position: 6
@@ -1,16 +1,19
1 ---
1 ---
2 trackers_001:
2 trackers_001:
3 name: Bug
3 name: Bug
4 id: 1
4 id: 1
5 is_in_chlog: true
5 is_in_chlog: true
6 default_status_id: 1
6 position: 1
7 position: 1
7 trackers_002:
8 trackers_002:
8 name: Feature request
9 name: Feature request
9 id: 2
10 id: 2
10 is_in_chlog: true
11 is_in_chlog: true
12 default_status_id: 1
11 position: 2
13 position: 2
12 trackers_003:
14 trackers_003:
13 name: Support request
15 name: Support request
14 id: 3
16 id: 3
15 is_in_chlog: false
17 is_in_chlog: false
18 default_status_id: 1
16 position: 3
19 position: 3
@@ -1,123 +1,136
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class IssueStatusesControllerTest < ActionController::TestCase
20 class IssueStatusesControllerTest < ActionController::TestCase
21 fixtures :issue_statuses, :issues, :users
21 fixtures :issue_statuses, :issues, :users
22
22
23 def setup
23 def setup
24 User.current = nil
24 User.current = nil
25 @request.session[:user_id] = 1 # admin
25 @request.session[:user_id] = 1 # admin
26 end
26 end
27
27
28 def test_index
28 def test_index
29 get :index
29 get :index
30 assert_response :success
30 assert_response :success
31 assert_template 'index'
31 assert_template 'index'
32 end
32 end
33
33
34 def test_index_by_anonymous_should_redirect_to_login_form
34 def test_index_by_anonymous_should_redirect_to_login_form
35 @request.session[:user_id] = nil
35 @request.session[:user_id] = nil
36 get :index
36 get :index
37 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fissue_statuses'
37 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fissue_statuses'
38 end
38 end
39
39
40 def test_index_by_user_should_respond_with_406
40 def test_index_by_user_should_respond_with_406
41 @request.session[:user_id] = 2
41 @request.session[:user_id] = 2
42 get :index
42 get :index
43 assert_response 406
43 assert_response 406
44 end
44 end
45
45
46 def test_new
46 def test_new
47 get :new
47 get :new
48 assert_response :success
48 assert_response :success
49 assert_template 'new'
49 assert_template 'new'
50 end
50 end
51
51
52 def test_create
52 def test_create
53 assert_difference 'IssueStatus.count' do
53 assert_difference 'IssueStatus.count' do
54 post :create, :issue_status => {:name => 'New status'}
54 post :create, :issue_status => {:name => 'New status'}
55 end
55 end
56 assert_redirected_to :action => 'index'
56 assert_redirected_to :action => 'index'
57 status = IssueStatus.order('id DESC').first
57 status = IssueStatus.order('id DESC').first
58 assert_equal 'New status', status.name
58 assert_equal 'New status', status.name
59 end
59 end
60
60
61 def test_create_with_failure
61 def test_create_with_failure
62 post :create, :issue_status => {:name => ''}
62 post :create, :issue_status => {:name => ''}
63 assert_response :success
63 assert_response :success
64 assert_template 'new'
64 assert_template 'new'
65 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
65 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
66 end
66 end
67
67
68 def test_edit
68 def test_edit
69 get :edit, :id => '3'
69 get :edit, :id => '3'
70 assert_response :success
70 assert_response :success
71 assert_template 'edit'
71 assert_template 'edit'
72 end
72 end
73
73
74 def test_update
74 def test_update
75 put :update, :id => '3', :issue_status => {:name => 'Renamed status'}
75 put :update, :id => '3', :issue_status => {:name => 'Renamed status'}
76 assert_redirected_to :action => 'index'
76 assert_redirected_to :action => 'index'
77 status = IssueStatus.find(3)
77 status = IssueStatus.find(3)
78 assert_equal 'Renamed status', status.name
78 assert_equal 'Renamed status', status.name
79 end
79 end
80
80
81 def test_update_with_failure
81 def test_update_with_failure
82 put :update, :id => '3', :issue_status => {:name => ''}
82 put :update, :id => '3', :issue_status => {:name => ''}
83 assert_response :success
83 assert_response :success
84 assert_template 'edit'
84 assert_template 'edit'
85 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
85 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
86 end
86 end
87
87
88 def test_destroy
88 def test_destroy
89 Issue.delete_all("status_id = 1")
89 Issue.where(:status_id => 1).delete_all
90 Tracker.where(:default_status_id => 1).delete_all
90
91
91 assert_difference 'IssueStatus.count', -1 do
92 assert_difference 'IssueStatus.count', -1 do
92 delete :destroy, :id => '1'
93 delete :destroy, :id => '1'
93 end
94 end
94 assert_redirected_to :action => 'index'
95 assert_redirected_to :action => 'index'
95 assert_nil IssueStatus.find_by_id(1)
96 assert_nil IssueStatus.find_by_id(1)
96 end
97 end
97
98
98 def test_destroy_should_block_if_status_in_use
99 def test_destroy_should_block_if_status_in_use
99 assert_not_nil Issue.find_by_status_id(1)
100 assert Issue.where(:status_id => 1).any?
101 Tracker.where(:default_status_id => 1).delete_all
102
103 assert_no_difference 'IssueStatus.count' do
104 delete :destroy, :id => '1'
105 end
106 assert_redirected_to :action => 'index'
107 assert_not_nil IssueStatus.find_by_id(1)
108 end
109
110 def test_destroy_should_block_if_status_in_use
111 Issue.where(:status_id => 1).delete_all
112 assert Tracker.where(:default_status_id => 1).any?
100
113
101 assert_no_difference 'IssueStatus.count' do
114 assert_no_difference 'IssueStatus.count' do
102 delete :destroy, :id => '1'
115 delete :destroy, :id => '1'
103 end
116 end
104 assert_redirected_to :action => 'index'
117 assert_redirected_to :action => 'index'
105 assert_not_nil IssueStatus.find_by_id(1)
118 assert_not_nil IssueStatus.find_by_id(1)
106 end
119 end
107
120
108 def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_field
121 def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_field
109 with_settings :issue_done_ratio => 'issue_field' do
122 with_settings :issue_done_ratio => 'issue_field' do
110 post :update_issue_done_ratio
123 post :update_issue_done_ratio
111 assert_match /not updated/, flash[:error].to_s
124 assert_match /not updated/, flash[:error].to_s
112 assert_redirected_to '/issue_statuses'
125 assert_redirected_to '/issue_statuses'
113 end
126 end
114 end
127 end
115
128
116 def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_status
129 def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_status
117 with_settings :issue_done_ratio => 'issue_status' do
130 with_settings :issue_done_ratio => 'issue_status' do
118 post :update_issue_done_ratio
131 post :update_issue_done_ratio
119 assert_match /Issue done ratios updated/, flash[:notice].to_s
132 assert_match /Issue done ratios updated/, flash[:notice].to_s
120 assert_redirected_to '/issue_statuses'
133 assert_redirected_to '/issue_statuses'
121 end
134 end
122 end
135 end
123 end
136 end
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,212 +1,212
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class TrackersControllerTest < ActionController::TestCase
20 class TrackersControllerTest < ActionController::TestCase
21 fixtures :trackers, :projects, :projects_trackers, :users, :issues, :custom_fields
21 fixtures :trackers, :projects, :projects_trackers, :users, :issues, :custom_fields, :issue_statuses
22
22
23 def setup
23 def setup
24 User.current = nil
24 User.current = nil
25 @request.session[:user_id] = 1 # admin
25 @request.session[:user_id] = 1 # admin
26 end
26 end
27
27
28 def test_index
28 def test_index
29 get :index
29 get :index
30 assert_response :success
30 assert_response :success
31 assert_template 'index'
31 assert_template 'index'
32 end
32 end
33
33
34 def test_index_by_anonymous_should_redirect_to_login_form
34 def test_index_by_anonymous_should_redirect_to_login_form
35 @request.session[:user_id] = nil
35 @request.session[:user_id] = nil
36 get :index
36 get :index
37 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftrackers'
37 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftrackers'
38 end
38 end
39
39
40 def test_index_by_user_should_respond_with_406
40 def test_index_by_user_should_respond_with_406
41 @request.session[:user_id] = 2
41 @request.session[:user_id] = 2
42 get :index
42 get :index
43 assert_response 406
43 assert_response 406
44 end
44 end
45
45
46 def test_new
46 def test_new
47 get :new
47 get :new
48 assert_response :success
48 assert_response :success
49 assert_template 'new'
49 assert_template 'new'
50 end
50 end
51
51
52 def test_create
52 def test_create
53 assert_difference 'Tracker.count' do
53 assert_difference 'Tracker.count' do
54 post :create, :tracker => { :name => 'New tracker', :project_ids => ['1', '', ''], :custom_field_ids => ['1', '6', ''] }
54 post :create, :tracker => { :name => 'New tracker', :default_status_id => 1, :project_ids => ['1', '', ''], :custom_field_ids => ['1', '6', ''] }
55 end
55 end
56 assert_redirected_to :action => 'index'
56 assert_redirected_to :action => 'index'
57 tracker = Tracker.order('id DESC').first
57 tracker = Tracker.order('id DESC').first
58 assert_equal 'New tracker', tracker.name
58 assert_equal 'New tracker', tracker.name
59 assert_equal [1], tracker.project_ids.sort
59 assert_equal [1], tracker.project_ids.sort
60 assert_equal Tracker::CORE_FIELDS, tracker.core_fields
60 assert_equal Tracker::CORE_FIELDS, tracker.core_fields
61 assert_equal [1, 6], tracker.custom_field_ids.sort
61 assert_equal [1, 6], tracker.custom_field_ids.sort
62 assert_equal 0, tracker.workflow_rules.count
62 assert_equal 0, tracker.workflow_rules.count
63 end
63 end
64
64
65 def create_with_disabled_core_fields
65 def test_create_with_disabled_core_fields
66 assert_difference 'Tracker.count' do
66 assert_difference 'Tracker.count' do
67 post :create, :tracker => { :name => 'New tracker', :core_fields => ['assigned_to_id', 'fixed_version_id', ''] }
67 post :create, :tracker => { :name => 'New tracker', :default_status_id => 1, :core_fields => ['assigned_to_id', 'fixed_version_id', ''] }
68 end
68 end
69 assert_redirected_to :action => 'index'
69 assert_redirected_to :action => 'index'
70 tracker = Tracker.order('id DESC').first
70 tracker = Tracker.order('id DESC').first
71 assert_equal 'New tracker', tracker.name
71 assert_equal 'New tracker', tracker.name
72 assert_equal %w(assigned_to_id fixed_version_id), tracker.core_fields
72 assert_equal %w(assigned_to_id fixed_version_id), tracker.core_fields
73 end
73 end
74
74
75 def test_create_new_with_workflow_copy
75 def test_create_new_with_workflow_copy
76 assert_difference 'Tracker.count' do
76 assert_difference 'Tracker.count' do
77 post :create, :tracker => { :name => 'New tracker' }, :copy_workflow_from => 1
77 post :create, :tracker => { :name => 'New tracker', :default_status_id => 1 }, :copy_workflow_from => 1
78 end
78 end
79 assert_redirected_to :action => 'index'
79 assert_redirected_to :action => 'index'
80 tracker = Tracker.find_by_name('New tracker')
80 tracker = Tracker.find_by_name('New tracker')
81 assert_equal 0, tracker.projects.count
81 assert_equal 0, tracker.projects.count
82 assert_equal Tracker.find(1).workflow_rules.count, tracker.workflow_rules.count
82 assert_equal Tracker.find(1).workflow_rules.count, tracker.workflow_rules.count
83 end
83 end
84
84
85 def test_create_with_failure
85 def test_create_with_failure
86 assert_no_difference 'Tracker.count' do
86 assert_no_difference 'Tracker.count' do
87 post :create, :tracker => { :name => '', :project_ids => ['1', '', ''],
87 post :create, :tracker => { :name => '', :project_ids => ['1', '', ''],
88 :custom_field_ids => ['1', '6', ''] }
88 :custom_field_ids => ['1', '6', ''] }
89 end
89 end
90 assert_response :success
90 assert_response :success
91 assert_template 'new'
91 assert_template 'new'
92 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
92 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
93 end
93 end
94
94
95 def test_edit
95 def test_edit
96 Tracker.find(1).project_ids = [1, 3]
96 Tracker.find(1).project_ids = [1, 3]
97
97
98 get :edit, :id => 1
98 get :edit, :id => 1
99 assert_response :success
99 assert_response :success
100 assert_template 'edit'
100 assert_template 'edit'
101
101
102 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
102 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
103 :value => '1',
103 :value => '1',
104 :checked => 'checked' }
104 :checked => 'checked' }
105
105
106 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
106 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
107 :value => '2',
107 :value => '2',
108 :checked => nil }
108 :checked => nil }
109
109
110 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
110 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
111 :value => '',
111 :value => '',
112 :type => 'hidden'}
112 :type => 'hidden'}
113 end
113 end
114
114
115 def test_edit_should_check_core_fields
115 def test_edit_should_check_core_fields
116 tracker = Tracker.find(1)
116 tracker = Tracker.find(1)
117 tracker.core_fields = %w(assigned_to_id fixed_version_id)
117 tracker.core_fields = %w(assigned_to_id fixed_version_id)
118 tracker.save!
118 tracker.save!
119
119
120 get :edit, :id => 1
120 get :edit, :id => 1
121 assert_response :success
121 assert_response :success
122 assert_template 'edit'
122 assert_template 'edit'
123
123
124 assert_select 'input[name=?][value=assigned_to_id][checked=checked]', 'tracker[core_fields][]'
124 assert_select 'input[name=?][value=assigned_to_id][checked=checked]', 'tracker[core_fields][]'
125 assert_select 'input[name=?][value=fixed_version_id][checked=checked]', 'tracker[core_fields][]'
125 assert_select 'input[name=?][value=fixed_version_id][checked=checked]', 'tracker[core_fields][]'
126
126
127 assert_select 'input[name=?][value=category_id]', 'tracker[core_fields][]'
127 assert_select 'input[name=?][value=category_id]', 'tracker[core_fields][]'
128 assert_select 'input[name=?][value=category_id][checked=checked]', 'tracker[core_fields][]', 0
128 assert_select 'input[name=?][value=category_id][checked=checked]', 'tracker[core_fields][]', 0
129
129
130 assert_select 'input[name=?][value=][type=hidden]', 'tracker[core_fields][]'
130 assert_select 'input[name=?][value=][type=hidden]', 'tracker[core_fields][]'
131 end
131 end
132
132
133 def test_update
133 def test_update
134 put :update, :id => 1, :tracker => { :name => 'Renamed',
134 put :update, :id => 1, :tracker => { :name => 'Renamed',
135 :project_ids => ['1', '2', ''] }
135 :project_ids => ['1', '2', ''] }
136 assert_redirected_to :action => 'index'
136 assert_redirected_to :action => 'index'
137 assert_equal [1, 2], Tracker.find(1).project_ids.sort
137 assert_equal [1, 2], Tracker.find(1).project_ids.sort
138 end
138 end
139
139
140 def test_update_without_projects
140 def test_update_without_projects
141 put :update, :id => 1, :tracker => { :name => 'Renamed',
141 put :update, :id => 1, :tracker => { :name => 'Renamed',
142 :project_ids => [''] }
142 :project_ids => [''] }
143 assert_redirected_to :action => 'index'
143 assert_redirected_to :action => 'index'
144 assert Tracker.find(1).project_ids.empty?
144 assert Tracker.find(1).project_ids.empty?
145 end
145 end
146
146
147 def test_update_without_core_fields
147 def test_update_without_core_fields
148 put :update, :id => 1, :tracker => { :name => 'Renamed', :core_fields => [''] }
148 put :update, :id => 1, :tracker => { :name => 'Renamed', :core_fields => [''] }
149 assert_redirected_to :action => 'index'
149 assert_redirected_to :action => 'index'
150 assert Tracker.find(1).core_fields.empty?
150 assert Tracker.find(1).core_fields.empty?
151 end
151 end
152
152
153 def test_update_with_failure
153 def test_update_with_failure
154 put :update, :id => 1, :tracker => { :name => '' }
154 put :update, :id => 1, :tracker => { :name => '' }
155 assert_response :success
155 assert_response :success
156 assert_template 'edit'
156 assert_template 'edit'
157 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
157 assert_error_tag :content => /name #{ESCAPED_CANT} be blank/i
158 end
158 end
159
159
160 def test_move_lower
160 def test_move_lower
161 tracker = Tracker.find_by_position(1)
161 tracker = Tracker.find_by_position(1)
162 put :update, :id => 1, :tracker => { :move_to => 'lower' }
162 put :update, :id => 1, :tracker => { :move_to => 'lower' }
163 assert_equal 2, tracker.reload.position
163 assert_equal 2, tracker.reload.position
164 end
164 end
165
165
166 def test_destroy
166 def test_destroy
167 tracker = Tracker.create!(:name => 'Destroyable')
167 tracker = Tracker.generate!(:name => 'Destroyable')
168 assert_difference 'Tracker.count', -1 do
168 assert_difference 'Tracker.count', -1 do
169 delete :destroy, :id => tracker.id
169 delete :destroy, :id => tracker.id
170 end
170 end
171 assert_redirected_to :action => 'index'
171 assert_redirected_to :action => 'index'
172 assert_nil flash[:error]
172 assert_nil flash[:error]
173 end
173 end
174
174
175 def test_destroy_tracker_in_use
175 def test_destroy_tracker_in_use
176 assert_no_difference 'Tracker.count' do
176 assert_no_difference 'Tracker.count' do
177 delete :destroy, :id => 1
177 delete :destroy, :id => 1
178 end
178 end
179 assert_redirected_to :action => 'index'
179 assert_redirected_to :action => 'index'
180 assert_not_nil flash[:error]
180 assert_not_nil flash[:error]
181 end
181 end
182
182
183 def test_get_fields
183 def test_get_fields
184 get :fields
184 get :fields
185 assert_response :success
185 assert_response :success
186 assert_template 'fields'
186 assert_template 'fields'
187
187
188 assert_select 'form' do
188 assert_select 'form' do
189 assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]'
189 assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]'
190 assert_select 'input[type=checkbox][name=?][value=2]', 'trackers[1][custom_field_ids][]'
190 assert_select 'input[type=checkbox][name=?][value=2]', 'trackers[1][custom_field_ids][]'
191
191
192 assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][core_fields][]'
192 assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][core_fields][]'
193 assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][custom_field_ids][]'
193 assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][custom_field_ids][]'
194 end
194 end
195 end
195 end
196
196
197 def test_post_fields
197 def test_post_fields
198 post :fields, :trackers => {
198 post :fields, :trackers => {
199 '1' => {'core_fields' => ['assigned_to_id', 'due_date', ''], 'custom_field_ids' => ['1', '2']},
199 '1' => {'core_fields' => ['assigned_to_id', 'due_date', ''], 'custom_field_ids' => ['1', '2']},
200 '2' => {'core_fields' => [''], 'custom_field_ids' => ['']}
200 '2' => {'core_fields' => [''], 'custom_field_ids' => ['']}
201 }
201 }
202 assert_redirected_to '/trackers/fields'
202 assert_redirected_to '/trackers/fields'
203
203
204 tracker = Tracker.find(1)
204 tracker = Tracker.find(1)
205 assert_equal %w(assigned_to_id due_date), tracker.core_fields
205 assert_equal %w(assigned_to_id due_date), tracker.core_fields
206 assert_equal [1, 2], tracker.custom_field_ids.sort
206 assert_equal [1, 2], tracker.custom_field_ids.sort
207
207
208 tracker = Tracker.find(2)
208 tracker = Tracker.find(2)
209 assert_equal [], tracker.core_fields
209 assert_equal [], tracker.core_fields
210 assert_equal [], tracker.custom_field_ids.sort
210 assert_equal [], tracker.custom_field_ids.sort
211 end
211 end
212 end
212 end
@@ -1,202 +1,233
1 module ObjectHelpers
1 module ObjectHelpers
2 def User.generate!(attributes={})
2 def User.generate!(attributes={})
3 @generated_user_login ||= 'user0'
3 @generated_user_login ||= 'user0'
4 @generated_user_login.succ!
4 @generated_user_login.succ!
5 user = User.new(attributes)
5 user = User.new(attributes)
6 user.login = @generated_user_login.dup if user.login.blank?
6 user.login = @generated_user_login.dup if user.login.blank?
7 user.mail = "#{@generated_user_login}@example.com" if user.mail.blank?
7 user.mail = "#{@generated_user_login}@example.com" if user.mail.blank?
8 user.firstname = "Bob" if user.firstname.blank?
8 user.firstname = "Bob" if user.firstname.blank?
9 user.lastname = "Doe" if user.lastname.blank?
9 user.lastname = "Doe" if user.lastname.blank?
10 yield user if block_given?
10 yield user if block_given?
11 user.save!
11 user.save!
12 user
12 user
13 end
13 end
14
14
15 def User.add_to_project(user, project, roles=nil)
15 def User.add_to_project(user, project, roles=nil)
16 roles = Role.find(1) if roles.nil?
16 roles = Role.find(1) if roles.nil?
17 roles = [roles] if roles.is_a?(Role)
17 roles = [roles] if roles.is_a?(Role)
18 Member.create!(:principal => user, :project => project, :roles => roles)
18 Member.create!(:principal => user, :project => project, :roles => roles)
19 end
19 end
20
20
21 def Group.generate!(attributes={})
21 def Group.generate!(attributes={})
22 @generated_group_name ||= 'Group 0'
22 @generated_group_name ||= 'Group 0'
23 @generated_group_name.succ!
23 @generated_group_name.succ!
24 group = Group.new(attributes)
24 group = Group.new(attributes)
25 group.name = @generated_group_name.dup if group.name.blank?
25 group.name = @generated_group_name.dup if group.name.blank?
26 yield group if block_given?
26 yield group if block_given?
27 group.save!
27 group.save!
28 group
28 group
29 end
29 end
30
30
31 def Project.generate!(attributes={})
31 def Project.generate!(attributes={})
32 @generated_project_identifier ||= 'project-0000'
32 @generated_project_identifier ||= 'project-0000'
33 @generated_project_identifier.succ!
33 @generated_project_identifier.succ!
34 project = Project.new(attributes)
34 project = Project.new(attributes)
35 project.name = @generated_project_identifier.dup if project.name.blank?
35 project.name = @generated_project_identifier.dup if project.name.blank?
36 project.identifier = @generated_project_identifier.dup if project.identifier.blank?
36 project.identifier = @generated_project_identifier.dup if project.identifier.blank?
37 yield project if block_given?
37 yield project if block_given?
38 project.save!
38 project.save!
39 project
39 project
40 end
40 end
41
41
42 def Project.generate_with_parent!(parent, attributes={})
42 def Project.generate_with_parent!(parent, attributes={})
43 project = Project.generate!(attributes)
43 project = Project.generate!(attributes)
44 project.set_parent!(parent)
44 project.set_parent!(parent)
45 project
45 project
46 end
46 end
47
47
48 def IssueStatus.generate!(attributes={})
49 @generated_status_name ||= 'Status 0'
50 @generated_status_name.succ!
51 status = IssueStatus.new(attributes)
52 status.name = @generated_status_name.dup if status.name.blank?
53 yield status if block_given?
54 status.save!
55 status
56 end
57
48 def Tracker.generate!(attributes={})
58 def Tracker.generate!(attributes={})
49 @generated_tracker_name ||= 'Tracker 0'
59 @generated_tracker_name ||= 'Tracker 0'
50 @generated_tracker_name.succ!
60 @generated_tracker_name.succ!
51 tracker = Tracker.new(attributes)
61 tracker = Tracker.new(attributes)
52 tracker.name = @generated_tracker_name.dup if tracker.name.blank?
62 tracker.name = @generated_tracker_name.dup if tracker.name.blank?
63 tracker.default_status ||= IssueStatus.order('position').first || IssueStatus.generate!
53 yield tracker if block_given?
64 yield tracker if block_given?
54 tracker.save!
65 tracker.save!
55 tracker
66 tracker
56 end
67 end
57
68
58 def Role.generate!(attributes={})
69 def Role.generate!(attributes={})
59 @generated_role_name ||= 'Role 0'
70 @generated_role_name ||= 'Role 0'
60 @generated_role_name.succ!
71 @generated_role_name.succ!
61 role = Role.new(attributes)
72 role = Role.new(attributes)
62 role.name = @generated_role_name.dup if role.name.blank?
73 role.name = @generated_role_name.dup if role.name.blank?
63 yield role if block_given?
74 yield role if block_given?
64 role.save!
75 role.save!
65 role
76 role
66 end
77 end
67
78
68 # Generates an unsaved Issue
79 # Generates an unsaved Issue
69 def Issue.generate(attributes={})
80 def Issue.generate(attributes={})
70 issue = Issue.new(attributes)
81 issue = Issue.new(attributes)
71 issue.project ||= Project.find(1)
82 issue.project ||= Project.find(1)
72 issue.tracker ||= issue.project.trackers.first
83 issue.tracker ||= issue.project.trackers.first
73 issue.subject = 'Generated' if issue.subject.blank?
84 issue.subject = 'Generated' if issue.subject.blank?
74 issue.author ||= User.find(2)
85 issue.author ||= User.find(2)
75 yield issue if block_given?
86 yield issue if block_given?
76 issue
87 issue
77 end
88 end
78
89
79 # Generates a saved Issue
90 # Generates a saved Issue
80 def Issue.generate!(attributes={}, &block)
91 def Issue.generate!(attributes={}, &block)
81 issue = Issue.generate(attributes, &block)
92 issue = Issue.generate(attributes, &block)
82 issue.save!
93 issue.save!
83 issue
94 issue
84 end
95 end
85
96
86 # Generates an issue with 2 children and a grandchild
97 # Generates an issue with 2 children and a grandchild
87 def Issue.generate_with_descendants!(attributes={})
98 def Issue.generate_with_descendants!(attributes={})
88 issue = Issue.generate!(attributes)
99 issue = Issue.generate!(attributes)
89 child = Issue.generate!(:project => issue.project, :subject => 'Child1', :parent_issue_id => issue.id)
100 child = Issue.generate!(:project => issue.project, :subject => 'Child1', :parent_issue_id => issue.id)
90 Issue.generate!(:project => issue.project, :subject => 'Child2', :parent_issue_id => issue.id)
101 Issue.generate!(:project => issue.project, :subject => 'Child2', :parent_issue_id => issue.id)
91 Issue.generate!(:project => issue.project, :subject => 'Child11', :parent_issue_id => child.id)
102 Issue.generate!(:project => issue.project, :subject => 'Child11', :parent_issue_id => child.id)
92 issue.reload
103 issue.reload
93 end
104 end
94
105
95 def Journal.generate!(attributes={})
106 def Journal.generate!(attributes={})
96 journal = Journal.new(attributes)
107 journal = Journal.new(attributes)
97 journal.user ||= User.first
108 journal.user ||= User.first
98 journal.journalized ||= Issue.first
109 journal.journalized ||= Issue.first
99 yield journal if block_given?
110 yield journal if block_given?
100 journal.save!
111 journal.save!
101 journal
112 journal
102 end
113 end
103
114
104 def Version.generate!(attributes={})
115 def Version.generate!(attributes={})
105 @generated_version_name ||= 'Version 0'
116 @generated_version_name ||= 'Version 0'
106 @generated_version_name.succ!
117 @generated_version_name.succ!
107 version = Version.new(attributes)
118 version = Version.new(attributes)
108 version.name = @generated_version_name.dup if version.name.blank?
119 version.name = @generated_version_name.dup if version.name.blank?
109 yield version if block_given?
120 yield version if block_given?
110 version.save!
121 version.save!
111 version
122 version
112 end
123 end
113
124
114 def TimeEntry.generate!(attributes={})
125 def TimeEntry.generate!(attributes={})
115 entry = TimeEntry.new(attributes)
126 entry = TimeEntry.new(attributes)
116 entry.user ||= User.find(2)
127 entry.user ||= User.find(2)
117 entry.issue ||= Issue.find(1) unless entry.project
128 entry.issue ||= Issue.find(1) unless entry.project
118 entry.project ||= entry.issue.project
129 entry.project ||= entry.issue.project
119 entry.activity ||= TimeEntryActivity.first
130 entry.activity ||= TimeEntryActivity.first
120 entry.spent_on ||= Date.today
131 entry.spent_on ||= Date.today
121 entry.hours ||= 1.0
132 entry.hours ||= 1.0
122 entry.save!
133 entry.save!
123 entry
134 entry
124 end
135 end
125
136
126 def AuthSource.generate!(attributes={})
137 def AuthSource.generate!(attributes={})
127 @generated_auth_source_name ||= 'Auth 0'
138 @generated_auth_source_name ||= 'Auth 0'
128 @generated_auth_source_name.succ!
139 @generated_auth_source_name.succ!
129 source = AuthSource.new(attributes)
140 source = AuthSource.new(attributes)
130 source.name = @generated_auth_source_name.dup if source.name.blank?
141 source.name = @generated_auth_source_name.dup if source.name.blank?
131 yield source if block_given?
142 yield source if block_given?
132 source.save!
143 source.save!
133 source
144 source
134 end
145 end
135
146
136 def Board.generate!(attributes={})
147 def Board.generate!(attributes={})
137 @generated_board_name ||= 'Forum 0'
148 @generated_board_name ||= 'Forum 0'
138 @generated_board_name.succ!
149 @generated_board_name.succ!
139 board = Board.new(attributes)
150 board = Board.new(attributes)
140 board.name = @generated_board_name.dup if board.name.blank?
151 board.name = @generated_board_name.dup if board.name.blank?
141 board.description = @generated_board_name.dup if board.description.blank?
152 board.description = @generated_board_name.dup if board.description.blank?
142 yield board if block_given?
153 yield board if block_given?
143 board.save!
154 board.save!
144 board
155 board
145 end
156 end
146
157
147 def Attachment.generate!(attributes={})
158 def Attachment.generate!(attributes={})
148 @generated_filename ||= 'testfile0'
159 @generated_filename ||= 'testfile0'
149 @generated_filename.succ!
160 @generated_filename.succ!
150 attributes = attributes.dup
161 attributes = attributes.dup
151 attachment = Attachment.new(attributes)
162 attachment = Attachment.new(attributes)
152 attachment.container ||= Issue.find(1)
163 attachment.container ||= Issue.find(1)
153 attachment.author ||= User.find(2)
164 attachment.author ||= User.find(2)
154 attachment.filename = @generated_filename.dup if attachment.filename.blank?
165 attachment.filename = @generated_filename.dup if attachment.filename.blank?
155 attachment.save!
166 attachment.save!
156 attachment
167 attachment
157 end
168 end
158
169
159 def CustomField.generate!(attributes={})
170 def CustomField.generate!(attributes={})
160 @generated_custom_field_name ||= 'Custom field 0'
171 @generated_custom_field_name ||= 'Custom field 0'
161 @generated_custom_field_name.succ!
172 @generated_custom_field_name.succ!
162 field = new(attributes)
173 field = new(attributes)
163 field.name = @generated_custom_field_name.dup if field.name.blank?
174 field.name = @generated_custom_field_name.dup if field.name.blank?
164 field.field_format = 'string' if field.field_format.blank?
175 field.field_format = 'string' if field.field_format.blank?
165 yield field if block_given?
176 yield field if block_given?
166 field.save!
177 field.save!
167 field
178 field
168 end
179 end
169
180
170 def Changeset.generate!(attributes={})
181 def Changeset.generate!(attributes={})
171 @generated_changeset_rev ||= '123456'
182 @generated_changeset_rev ||= '123456'
172 @generated_changeset_rev.succ!
183 @generated_changeset_rev.succ!
173 changeset = new(attributes)
184 changeset = new(attributes)
174 changeset.repository ||= Project.find(1).repository
185 changeset.repository ||= Project.find(1).repository
175 changeset.revision ||= @generated_changeset_rev
186 changeset.revision ||= @generated_changeset_rev
176 changeset.committed_on ||= Time.now
187 changeset.committed_on ||= Time.now
177 yield changeset if block_given?
188 yield changeset if block_given?
178 changeset.save!
189 changeset.save!
179 changeset
190 changeset
180 end
191 end
181
192
182 def Query.generate!(attributes={})
193 def Query.generate!(attributes={})
183 query = new(attributes)
194 query = new(attributes)
184 query.name = "Generated query" if query.name.blank?
195 query.name = "Generated query" if query.name.blank?
185 query.user ||= User.find(1)
196 query.user ||= User.find(1)
186 query.save!
197 query.save!
187 query
198 query
188 end
199 end
189 end
200 end
190
201
202 module TrackerObjectHelpers
203 def generate_transitions!(*args)
204 options = args.last.is_a?(Hash) ? args.pop : {}
205 if args.size == 1
206 args << args.first
207 end
208 if options[:clear]
209 WorkflowTransition.where(:tracker_id => id).delete_all
210 end
211 args.each_cons(2) do |old_status_id, new_status_id|
212 WorkflowTransition.create!(
213 :tracker => self,
214 :role_id => (options[:role_id] || 1),
215 :old_status_id => old_status_id,
216 :new_status_id => new_status_id
217 )
218 end
219 end
220 end
221 Tracker.send :include, TrackerObjectHelpers
222
191 module IssueObjectHelpers
223 module IssueObjectHelpers
192 def close!
224 def close!
193 self.status = IssueStatus.where(:is_closed => true).first
225 self.status = IssueStatus.where(:is_closed => true).first
194 save!
226 save!
195 end
227 end
196
228
197 def generate_child!(attributes={})
229 def generate_child!(attributes={})
198 Issue.generate!(attributes.merge(:parent_issue_id => self.id))
230 Issue.generate!(attributes.merge(:parent_issue_id => self.id))
199 end
231 end
200 end
232 end
201
202 Issue.send :include, IssueObjectHelpers
233 Issue.send :include, IssueObjectHelpers
@@ -1,123 +1,99
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class IssueStatusTest < ActiveSupport::TestCase
20 class IssueStatusTest < ActiveSupport::TestCase
21 fixtures :issue_statuses, :issues, :roles, :trackers
21 fixtures :issue_statuses, :issues, :roles, :trackers
22
22
23 def test_create
23 def test_create
24 status = IssueStatus.new :name => "Assigned"
24 status = IssueStatus.new :name => "Assigned"
25 assert !status.save
25 assert !status.save
26 # status name uniqueness
26 # status name uniqueness
27 assert_equal 1, status.errors.count
27 assert_equal 1, status.errors.count
28
28
29 status.name = "Test Status"
29 status.name = "Test Status"
30 assert status.save
30 assert status.save
31 assert !status.is_default
32 end
31 end
33
32
34 def test_destroy
33 def test_destroy
35 status = IssueStatus.find(3)
34 status = IssueStatus.find(3)
36 assert_difference 'IssueStatus.count', -1 do
35 assert_difference 'IssueStatus.count', -1 do
37 assert status.destroy
36 assert status.destroy
38 end
37 end
39 assert_nil WorkflowTransition.where(:old_status_id => status.id).first
38 assert_nil WorkflowTransition.where(:old_status_id => status.id).first
40 assert_nil WorkflowTransition.where(:new_status_id => status.id).first
39 assert_nil WorkflowTransition.where(:new_status_id => status.id).first
41 end
40 end
42
41
43 def test_destroy_status_in_use
42 def test_destroy_status_in_use
44 # Status assigned to an Issue
43 # Status assigned to an Issue
45 status = Issue.find(1).status
44 status = Issue.find(1).status
46 assert_raise(RuntimeError, "Can't delete status") { status.destroy }
45 assert_raise(RuntimeError, "Can't delete status") { status.destroy }
47 end
46 end
48
47
49 def test_default
50 status = IssueStatus.default
51 assert_kind_of IssueStatus, status
52 end
53
54 def test_change_default
55 status = IssueStatus.find(2)
56 assert !status.is_default
57 status.is_default = true
58 assert status.save
59 status.reload
60
61 assert_equal status, IssueStatus.default
62 assert !IssueStatus.find(1).is_default
63 end
64
65 def test_reorder_should_not_clear_default_status
66 status = IssueStatus.default
67 status.move_to_bottom
68 status.reload
69 assert status.is_default?
70 end
71
72 def test_new_statuses_allowed_to
48 def test_new_statuses_allowed_to
73 WorkflowTransition.delete_all
49 WorkflowTransition.delete_all
74
50
75 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
51 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
76 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
52 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
77 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
53 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
78 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
54 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
79 status = IssueStatus.find(1)
55 status = IssueStatus.find(1)
80 role = Role.find(1)
56 role = Role.find(1)
81 tracker = Tracker.find(1)
57 tracker = Tracker.find(1)
82
58
83 assert_equal [2], status.new_statuses_allowed_to([role], tracker, false, false).map(&:id)
59 assert_equal [2], status.new_statuses_allowed_to([role], tracker, false, false).map(&:id)
84 assert_equal [2], status.find_new_statuses_allowed_to([role], tracker, false, false).map(&:id)
60 assert_equal [2], status.find_new_statuses_allowed_to([role], tracker, false, false).map(&:id)
85
61
86 assert_equal [2, 3, 5], status.new_statuses_allowed_to([role], tracker, true, false).map(&:id)
62 assert_equal [2, 3, 5], status.new_statuses_allowed_to([role], tracker, true, false).map(&:id)
87 assert_equal [2, 3, 5], status.find_new_statuses_allowed_to([role], tracker, true, false).map(&:id)
63 assert_equal [2, 3, 5], status.find_new_statuses_allowed_to([role], tracker, true, false).map(&:id)
88
64
89 assert_equal [2, 4, 5], status.new_statuses_allowed_to([role], tracker, false, true).map(&:id)
65 assert_equal [2, 4, 5], status.new_statuses_allowed_to([role], tracker, false, true).map(&:id)
90 assert_equal [2, 4, 5], status.find_new_statuses_allowed_to([role], tracker, false, true).map(&:id)
66 assert_equal [2, 4, 5], status.find_new_statuses_allowed_to([role], tracker, false, true).map(&:id)
91
67
92 assert_equal [2, 3, 4, 5], status.new_statuses_allowed_to([role], tracker, true, true).map(&:id)
68 assert_equal [2, 3, 4, 5], status.new_statuses_allowed_to([role], tracker, true, true).map(&:id)
93 assert_equal [2, 3, 4, 5], status.find_new_statuses_allowed_to([role], tracker, true, true).map(&:id)
69 assert_equal [2, 3, 4, 5], status.find_new_statuses_allowed_to([role], tracker, true, true).map(&:id)
94 end
70 end
95
71
96 def test_update_done_ratios_with_issue_done_ratio_set_to_issue_field_should_change_nothing
72 def test_update_done_ratios_with_issue_done_ratio_set_to_issue_field_should_change_nothing
97 IssueStatus.find(1).update_attribute(:default_done_ratio, 50)
73 IssueStatus.find(1).update_attribute(:default_done_ratio, 50)
98
74
99 with_settings :issue_done_ratio => 'issue_field' do
75 with_settings :issue_done_ratio => 'issue_field' do
100 IssueStatus.update_issue_done_ratios
76 IssueStatus.update_issue_done_ratios
101 assert_equal 0, Issue.where(:done_ratio => 50).count
77 assert_equal 0, Issue.where(:done_ratio => 50).count
102 end
78 end
103 end
79 end
104
80
105 def test_update_done_ratios_with_issue_done_ratio_set_to_issue_status_should_update_issues
81 def test_update_done_ratios_with_issue_done_ratio_set_to_issue_status_should_update_issues
106 IssueStatus.find(1).update_attribute(:default_done_ratio, 50)
82 IssueStatus.find(1).update_attribute(:default_done_ratio, 50)
107 with_settings :issue_done_ratio => 'issue_status' do
83 with_settings :issue_done_ratio => 'issue_status' do
108 IssueStatus.update_issue_done_ratios
84 IssueStatus.update_issue_done_ratios
109 issues = Issue.where(:status_id => 1)
85 issues = Issue.where(:status_id => 1)
110 assert_equal [50], issues.map {|issue| issue.read_attribute(:done_ratio)}.uniq
86 assert_equal [50], issues.map {|issue| issue.read_attribute(:done_ratio)}.uniq
111 end
87 end
112 end
88 end
113
89
114 def test_sorted_scope
90 def test_sorted_scope
115 assert_equal IssueStatus.all.sort, IssueStatus.sorted.to_a
91 assert_equal IssueStatus.all.sort, IssueStatus.sorted.to_a
116 end
92 end
117
93
118 def test_named_scope
94 def test_named_scope
119 status = IssueStatus.named("resolved").first
95 status = IssueStatus.named("resolved").first
120 assert_not_nil status
96 assert_not_nil status
121 assert_equal "Resolved", status.name
97 assert_equal "Resolved", status.name
122 end
98 end
123 end
99 end
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
General Comments 0
You need to be logged in to leave comments. Login now