##// END OF EJS Templates
Adds a setting to allow subtasks to belong to other projects (#5487)....
Jean-Philippe Lang -
r10376:83bcc1f04351
parent child
Show More
@@ -1,396 +1,396
1 # encoding: utf-8
1 # encoding: utf-8
2 #
2 #
3 # Redmine - project management software
3 # Redmine - project management software
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 #
5 #
6 # This program is free software; you can redistribute it and/or
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
9 # of the License, or (at your option) any later version.
10 #
10 #
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
14 # GNU General Public License for more details.
15 #
15 #
16 # You should have received a copy of the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
19
20 module IssuesHelper
20 module IssuesHelper
21 include ApplicationHelper
21 include ApplicationHelper
22
22
23 def issue_list(issues, &block)
23 def issue_list(issues, &block)
24 ancestors = []
24 ancestors = []
25 issues.each do |issue|
25 issues.each do |issue|
26 while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
26 while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
27 ancestors.pop
27 ancestors.pop
28 end
28 end
29 yield issue, ancestors.size
29 yield issue, ancestors.size
30 ancestors << issue unless issue.leaf?
30 ancestors << issue unless issue.leaf?
31 end
31 end
32 end
32 end
33
33
34 # Renders a HTML/CSS tooltip
34 # Renders a HTML/CSS tooltip
35 #
35 #
36 # To use, a trigger div is needed. This is a div with the class of "tooltip"
36 # To use, a trigger div is needed. This is a div with the class of "tooltip"
37 # that contains this method wrapped in a span with the class of "tip"
37 # that contains this method wrapped in a span with the class of "tip"
38 #
38 #
39 # <div class="tooltip"><%= link_to_issue(issue) %>
39 # <div class="tooltip"><%= link_to_issue(issue) %>
40 # <span class="tip"><%= render_issue_tooltip(issue) %></span>
40 # <span class="tip"><%= render_issue_tooltip(issue) %></span>
41 # </div>
41 # </div>
42 #
42 #
43 def render_issue_tooltip(issue)
43 def render_issue_tooltip(issue)
44 @cached_label_status ||= l(:field_status)
44 @cached_label_status ||= l(:field_status)
45 @cached_label_start_date ||= l(:field_start_date)
45 @cached_label_start_date ||= l(:field_start_date)
46 @cached_label_due_date ||= l(:field_due_date)
46 @cached_label_due_date ||= l(:field_due_date)
47 @cached_label_assigned_to ||= l(:field_assigned_to)
47 @cached_label_assigned_to ||= l(:field_assigned_to)
48 @cached_label_priority ||= l(:field_priority)
48 @cached_label_priority ||= l(:field_priority)
49 @cached_label_project ||= l(:field_project)
49 @cached_label_project ||= l(:field_project)
50
50
51 link_to_issue(issue) + "<br /><br />".html_safe +
51 link_to_issue(issue) + "<br /><br />".html_safe +
52 "<strong>#{@cached_label_project}</strong>: #{link_to_project(issue.project)}<br />".html_safe +
52 "<strong>#{@cached_label_project}</strong>: #{link_to_project(issue.project)}<br />".html_safe +
53 "<strong>#{@cached_label_status}</strong>: #{h(issue.status.name)}<br />".html_safe +
53 "<strong>#{@cached_label_status}</strong>: #{h(issue.status.name)}<br />".html_safe +
54 "<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />".html_safe +
54 "<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />".html_safe +
55 "<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.due_date)}<br />".html_safe +
55 "<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.due_date)}<br />".html_safe +
56 "<strong>#{@cached_label_assigned_to}</strong>: #{h(issue.assigned_to)}<br />".html_safe +
56 "<strong>#{@cached_label_assigned_to}</strong>: #{h(issue.assigned_to)}<br />".html_safe +
57 "<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe
57 "<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe
58 end
58 end
59
59
60 def issue_heading(issue)
60 def issue_heading(issue)
61 h("#{issue.tracker} ##{issue.id}")
61 h("#{issue.tracker} ##{issue.id}")
62 end
62 end
63
63
64 def render_issue_subject_with_tree(issue)
64 def render_issue_subject_with_tree(issue)
65 s = ''
65 s = ''
66 ancestors = issue.root? ? [] : issue.ancestors.visible.all
66 ancestors = issue.root? ? [] : issue.ancestors.visible.all
67 ancestors.each do |ancestor|
67 ancestors.each do |ancestor|
68 s << '<div>' + content_tag('p', link_to_issue(ancestor))
68 s << '<div>' + content_tag('p', link_to_issue(ancestor, :project => (issue.project_id != ancestor.project_id)))
69 end
69 end
70 s << '<div>'
70 s << '<div>'
71 subject = h(issue.subject)
71 subject = h(issue.subject)
72 if issue.is_private?
72 if issue.is_private?
73 subject = content_tag('span', l(:field_is_private), :class => 'private') + ' ' + subject
73 subject = content_tag('span', l(:field_is_private), :class => 'private') + ' ' + subject
74 end
74 end
75 s << content_tag('h3', subject)
75 s << content_tag('h3', subject)
76 s << '</div>' * (ancestors.size + 1)
76 s << '</div>' * (ancestors.size + 1)
77 s.html_safe
77 s.html_safe
78 end
78 end
79
79
80 def render_descendants_tree(issue)
80 def render_descendants_tree(issue)
81 s = '<form><table class="list issues">'
81 s = '<form><table class="list issues">'
82 issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
82 issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
83 s << content_tag('tr',
83 s << content_tag('tr',
84 content_tag('td', check_box_tag("ids[]", child.id, false, :id => nil), :class => 'checkbox') +
84 content_tag('td', check_box_tag("ids[]", child.id, false, :id => nil), :class => 'checkbox') +
85 content_tag('td', link_to_issue(child, :truncate => 60), :class => 'subject') +
85 content_tag('td', link_to_issue(child, :truncate => 60, :project => (issue.project_id != child.project_id)), :class => 'subject') +
86 content_tag('td', h(child.status)) +
86 content_tag('td', h(child.status)) +
87 content_tag('td', link_to_user(child.assigned_to)) +
87 content_tag('td', link_to_user(child.assigned_to)) +
88 content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
88 content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
89 :class => "issue issue-#{child.id} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
89 :class => "issue issue-#{child.id} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
90 end
90 end
91 s << '</table></form>'
91 s << '</table></form>'
92 s.html_safe
92 s.html_safe
93 end
93 end
94
94
95 class IssueFieldsRows
95 class IssueFieldsRows
96 include ActionView::Helpers::TagHelper
96 include ActionView::Helpers::TagHelper
97
97
98 def initialize
98 def initialize
99 @left = []
99 @left = []
100 @right = []
100 @right = []
101 end
101 end
102
102
103 def left(*args)
103 def left(*args)
104 args.any? ? @left << cells(*args) : @left
104 args.any? ? @left << cells(*args) : @left
105 end
105 end
106
106
107 def right(*args)
107 def right(*args)
108 args.any? ? @right << cells(*args) : @right
108 args.any? ? @right << cells(*args) : @right
109 end
109 end
110
110
111 def size
111 def size
112 @left.size > @right.size ? @left.size : @right.size
112 @left.size > @right.size ? @left.size : @right.size
113 end
113 end
114
114
115 def to_html
115 def to_html
116 html = ''.html_safe
116 html = ''.html_safe
117 blank = content_tag('th', '') + content_tag('td', '')
117 blank = content_tag('th', '') + content_tag('td', '')
118 size.times do |i|
118 size.times do |i|
119 left = @left[i] || blank
119 left = @left[i] || blank
120 right = @right[i] || blank
120 right = @right[i] || blank
121 html << content_tag('tr', left + right)
121 html << content_tag('tr', left + right)
122 end
122 end
123 html
123 html
124 end
124 end
125
125
126 def cells(label, text, options={})
126 def cells(label, text, options={})
127 content_tag('th', "#{label}:", options) + content_tag('td', text, options)
127 content_tag('th', "#{label}:", options) + content_tag('td', text, options)
128 end
128 end
129 end
129 end
130
130
131 def issue_fields_rows
131 def issue_fields_rows
132 r = IssueFieldsRows.new
132 r = IssueFieldsRows.new
133 yield r
133 yield r
134 r.to_html
134 r.to_html
135 end
135 end
136
136
137 def render_custom_fields_rows(issue)
137 def render_custom_fields_rows(issue)
138 return if issue.custom_field_values.empty?
138 return if issue.custom_field_values.empty?
139 ordered_values = []
139 ordered_values = []
140 half = (issue.custom_field_values.size / 2.0).ceil
140 half = (issue.custom_field_values.size / 2.0).ceil
141 half.times do |i|
141 half.times do |i|
142 ordered_values << issue.custom_field_values[i]
142 ordered_values << issue.custom_field_values[i]
143 ordered_values << issue.custom_field_values[i + half]
143 ordered_values << issue.custom_field_values[i + half]
144 end
144 end
145 s = "<tr>\n"
145 s = "<tr>\n"
146 n = 0
146 n = 0
147 ordered_values.compact.each do |value|
147 ordered_values.compact.each do |value|
148 s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
148 s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
149 s << "\t<th>#{ h(value.custom_field.name) }:</th><td>#{ simple_format_without_paragraph(h(show_value(value))) }</td>\n"
149 s << "\t<th>#{ h(value.custom_field.name) }:</th><td>#{ simple_format_without_paragraph(h(show_value(value))) }</td>\n"
150 n += 1
150 n += 1
151 end
151 end
152 s << "</tr>\n"
152 s << "</tr>\n"
153 s.html_safe
153 s.html_safe
154 end
154 end
155
155
156 def issues_destroy_confirmation_message(issues)
156 def issues_destroy_confirmation_message(issues)
157 issues = [issues] unless issues.is_a?(Array)
157 issues = [issues] unless issues.is_a?(Array)
158 message = l(:text_issues_destroy_confirmation)
158 message = l(:text_issues_destroy_confirmation)
159 descendant_count = issues.inject(0) {|memo, i| memo += (i.right - i.left - 1)/2}
159 descendant_count = issues.inject(0) {|memo, i| memo += (i.right - i.left - 1)/2}
160 if descendant_count > 0
160 if descendant_count > 0
161 issues.each do |issue|
161 issues.each do |issue|
162 next if issue.root?
162 next if issue.root?
163 issues.each do |other_issue|
163 issues.each do |other_issue|
164 descendant_count -= 1 if issue.is_descendant_of?(other_issue)
164 descendant_count -= 1 if issue.is_descendant_of?(other_issue)
165 end
165 end
166 end
166 end
167 if descendant_count > 0
167 if descendant_count > 0
168 message << "\n" + l(:text_issues_destroy_descendants_confirmation, :count => descendant_count)
168 message << "\n" + l(:text_issues_destroy_descendants_confirmation, :count => descendant_count)
169 end
169 end
170 end
170 end
171 message
171 message
172 end
172 end
173
173
174 def sidebar_queries
174 def sidebar_queries
175 unless @sidebar_queries
175 unless @sidebar_queries
176 @sidebar_queries = Query.visible.all(
176 @sidebar_queries = Query.visible.all(
177 :order => "#{Query.table_name}.name ASC",
177 :order => "#{Query.table_name}.name ASC",
178 # Project specific queries and global queries
178 # Project specific queries and global queries
179 :conditions => (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
179 :conditions => (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
180 )
180 )
181 end
181 end
182 @sidebar_queries
182 @sidebar_queries
183 end
183 end
184
184
185 def query_links(title, queries)
185 def query_links(title, queries)
186 # links to #index on issues/show
186 # links to #index on issues/show
187 url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
187 url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
188
188
189 content_tag('h3', h(title)) +
189 content_tag('h3', h(title)) +
190 queries.collect {|query|
190 queries.collect {|query|
191 css = 'query'
191 css = 'query'
192 css << ' selected' if query == @query
192 css << ' selected' if query == @query
193 link_to(h(query.name), url_params.merge(:query_id => query), :class => css)
193 link_to(h(query.name), url_params.merge(:query_id => query), :class => css)
194 }.join('<br />').html_safe
194 }.join('<br />').html_safe
195 end
195 end
196
196
197 def render_sidebar_queries
197 def render_sidebar_queries
198 out = ''.html_safe
198 out = ''.html_safe
199 queries = sidebar_queries.select {|q| !q.is_public?}
199 queries = sidebar_queries.select {|q| !q.is_public?}
200 out << query_links(l(:label_my_queries), queries) if queries.any?
200 out << query_links(l(:label_my_queries), queries) if queries.any?
201 queries = sidebar_queries.select {|q| q.is_public?}
201 queries = sidebar_queries.select {|q| q.is_public?}
202 out << query_links(l(:label_query_plural), queries) if queries.any?
202 out << query_links(l(:label_query_plural), queries) if queries.any?
203 out
203 out
204 end
204 end
205
205
206 # Returns the textual representation of a journal details
206 # Returns the textual representation of a journal details
207 # as an array of strings
207 # as an array of strings
208 def details_to_strings(details, no_html=false, options={})
208 def details_to_strings(details, no_html=false, options={})
209 options[:only_path] = (options[:only_path] == false ? false : true)
209 options[:only_path] = (options[:only_path] == false ? false : true)
210 strings = []
210 strings = []
211 values_by_field = {}
211 values_by_field = {}
212 details.each do |detail|
212 details.each do |detail|
213 if detail.property == 'cf'
213 if detail.property == 'cf'
214 field_id = detail.prop_key
214 field_id = detail.prop_key
215 field = CustomField.find_by_id(field_id)
215 field = CustomField.find_by_id(field_id)
216 if field && field.multiple?
216 if field && field.multiple?
217 values_by_field[field_id] ||= {:added => [], :deleted => []}
217 values_by_field[field_id] ||= {:added => [], :deleted => []}
218 if detail.old_value
218 if detail.old_value
219 values_by_field[field_id][:deleted] << detail.old_value
219 values_by_field[field_id][:deleted] << detail.old_value
220 end
220 end
221 if detail.value
221 if detail.value
222 values_by_field[field_id][:added] << detail.value
222 values_by_field[field_id][:added] << detail.value
223 end
223 end
224 next
224 next
225 end
225 end
226 end
226 end
227 strings << show_detail(detail, no_html, options)
227 strings << show_detail(detail, no_html, options)
228 end
228 end
229 values_by_field.each do |field_id, changes|
229 values_by_field.each do |field_id, changes|
230 detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
230 detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
231 if changes[:added].any?
231 if changes[:added].any?
232 detail.value = changes[:added]
232 detail.value = changes[:added]
233 strings << show_detail(detail, no_html, options)
233 strings << show_detail(detail, no_html, options)
234 elsif changes[:deleted].any?
234 elsif changes[:deleted].any?
235 detail.old_value = changes[:deleted]
235 detail.old_value = changes[:deleted]
236 strings << show_detail(detail, no_html, options)
236 strings << show_detail(detail, no_html, options)
237 end
237 end
238 end
238 end
239 strings
239 strings
240 end
240 end
241
241
242 # Returns the textual representation of a single journal detail
242 # Returns the textual representation of a single journal detail
243 def show_detail(detail, no_html=false, options={})
243 def show_detail(detail, no_html=false, options={})
244 multiple = false
244 multiple = false
245 case detail.property
245 case detail.property
246 when 'attr'
246 when 'attr'
247 field = detail.prop_key.to_s.gsub(/\_id$/, "")
247 field = detail.prop_key.to_s.gsub(/\_id$/, "")
248 label = l(("field_" + field).to_sym)
248 label = l(("field_" + field).to_sym)
249 case detail.prop_key
249 case detail.prop_key
250 when 'due_date', 'start_date'
250 when 'due_date', 'start_date'
251 value = format_date(detail.value.to_date) if detail.value
251 value = format_date(detail.value.to_date) if detail.value
252 old_value = format_date(detail.old_value.to_date) if detail.old_value
252 old_value = format_date(detail.old_value.to_date) if detail.old_value
253
253
254 when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
254 when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
255 'priority_id', 'category_id', 'fixed_version_id'
255 'priority_id', 'category_id', 'fixed_version_id'
256 value = find_name_by_reflection(field, detail.value)
256 value = find_name_by_reflection(field, detail.value)
257 old_value = find_name_by_reflection(field, detail.old_value)
257 old_value = find_name_by_reflection(field, detail.old_value)
258
258
259 when 'estimated_hours'
259 when 'estimated_hours'
260 value = "%0.02f" % detail.value.to_f unless detail.value.blank?
260 value = "%0.02f" % detail.value.to_f unless detail.value.blank?
261 old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
261 old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
262
262
263 when 'parent_id'
263 when 'parent_id'
264 label = l(:field_parent_issue)
264 label = l(:field_parent_issue)
265 value = "##{detail.value}" unless detail.value.blank?
265 value = "##{detail.value}" unless detail.value.blank?
266 old_value = "##{detail.old_value}" unless detail.old_value.blank?
266 old_value = "##{detail.old_value}" unless detail.old_value.blank?
267
267
268 when 'is_private'
268 when 'is_private'
269 value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
269 value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
270 old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
270 old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
271 end
271 end
272 when 'cf'
272 when 'cf'
273 custom_field = CustomField.find_by_id(detail.prop_key)
273 custom_field = CustomField.find_by_id(detail.prop_key)
274 if custom_field
274 if custom_field
275 multiple = custom_field.multiple?
275 multiple = custom_field.multiple?
276 label = custom_field.name
276 label = custom_field.name
277 value = format_value(detail.value, custom_field.field_format) if detail.value
277 value = format_value(detail.value, custom_field.field_format) if detail.value
278 old_value = format_value(detail.old_value, custom_field.field_format) if detail.old_value
278 old_value = format_value(detail.old_value, custom_field.field_format) if detail.old_value
279 end
279 end
280 when 'attachment'
280 when 'attachment'
281 label = l(:label_attachment)
281 label = l(:label_attachment)
282 end
282 end
283 call_hook(:helper_issues_show_detail_after_setting,
283 call_hook(:helper_issues_show_detail_after_setting,
284 {:detail => detail, :label => label, :value => value, :old_value => old_value })
284 {:detail => detail, :label => label, :value => value, :old_value => old_value })
285
285
286 label ||= detail.prop_key
286 label ||= detail.prop_key
287 value ||= detail.value
287 value ||= detail.value
288 old_value ||= detail.old_value
288 old_value ||= detail.old_value
289
289
290 unless no_html
290 unless no_html
291 label = content_tag('strong', label)
291 label = content_tag('strong', label)
292 old_value = content_tag("i", h(old_value)) if detail.old_value
292 old_value = content_tag("i", h(old_value)) if detail.old_value
293 old_value = content_tag("del", old_value) if detail.old_value and detail.value.blank?
293 old_value = content_tag("del", old_value) if detail.old_value and detail.value.blank?
294 if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key)
294 if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key)
295 # Link to the attachment if it has not been removed
295 # Link to the attachment if it has not been removed
296 value = link_to_attachment(atta, :download => true, :only_path => options[:only_path])
296 value = link_to_attachment(atta, :download => true, :only_path => options[:only_path])
297 if options[:only_path] != false && atta.is_text?
297 if options[:only_path] != false && atta.is_text?
298 value += link_to(
298 value += link_to(
299 image_tag('magnifier.png'),
299 image_tag('magnifier.png'),
300 :controller => 'attachments', :action => 'show',
300 :controller => 'attachments', :action => 'show',
301 :id => atta, :filename => atta.filename
301 :id => atta, :filename => atta.filename
302 )
302 )
303 end
303 end
304 else
304 else
305 value = content_tag("i", h(value)) if value
305 value = content_tag("i", h(value)) if value
306 end
306 end
307 end
307 end
308
308
309 if detail.property == 'attr' && detail.prop_key == 'description'
309 if detail.property == 'attr' && detail.prop_key == 'description'
310 s = l(:text_journal_changed_no_detail, :label => label)
310 s = l(:text_journal_changed_no_detail, :label => label)
311 unless no_html
311 unless no_html
312 diff_link = link_to 'diff',
312 diff_link = link_to 'diff',
313 {:controller => 'journals', :action => 'diff', :id => detail.journal_id,
313 {:controller => 'journals', :action => 'diff', :id => detail.journal_id,
314 :detail_id => detail.id, :only_path => options[:only_path]},
314 :detail_id => detail.id, :only_path => options[:only_path]},
315 :title => l(:label_view_diff)
315 :title => l(:label_view_diff)
316 s << " (#{ diff_link })"
316 s << " (#{ diff_link })"
317 end
317 end
318 s.html_safe
318 s.html_safe
319 elsif detail.value.present?
319 elsif detail.value.present?
320 case detail.property
320 case detail.property
321 when 'attr', 'cf'
321 when 'attr', 'cf'
322 if detail.old_value.present?
322 if detail.old_value.present?
323 l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
323 l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
324 elsif multiple
324 elsif multiple
325 l(:text_journal_added, :label => label, :value => value).html_safe
325 l(:text_journal_added, :label => label, :value => value).html_safe
326 else
326 else
327 l(:text_journal_set_to, :label => label, :value => value).html_safe
327 l(:text_journal_set_to, :label => label, :value => value).html_safe
328 end
328 end
329 when 'attachment'
329 when 'attachment'
330 l(:text_journal_added, :label => label, :value => value).html_safe
330 l(:text_journal_added, :label => label, :value => value).html_safe
331 end
331 end
332 else
332 else
333 l(:text_journal_deleted, :label => label, :old => old_value).html_safe
333 l(:text_journal_deleted, :label => label, :old => old_value).html_safe
334 end
334 end
335 end
335 end
336
336
337 # Find the name of an associated record stored in the field attribute
337 # Find the name of an associated record stored in the field attribute
338 def find_name_by_reflection(field, id)
338 def find_name_by_reflection(field, id)
339 association = Issue.reflect_on_association(field.to_sym)
339 association = Issue.reflect_on_association(field.to_sym)
340 if association
340 if association
341 record = association.class_name.constantize.find_by_id(id)
341 record = association.class_name.constantize.find_by_id(id)
342 return record.name if record
342 return record.name if record
343 end
343 end
344 end
344 end
345
345
346 # Renders issue children recursively
346 # Renders issue children recursively
347 def render_api_issue_children(issue, api)
347 def render_api_issue_children(issue, api)
348 return if issue.leaf?
348 return if issue.leaf?
349 api.array :children do
349 api.array :children do
350 issue.children.each do |child|
350 issue.children.each do |child|
351 api.issue(:id => child.id) do
351 api.issue(:id => child.id) do
352 api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil?
352 api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil?
353 api.subject child.subject
353 api.subject child.subject
354 render_api_issue_children(child, api)
354 render_api_issue_children(child, api)
355 end
355 end
356 end
356 end
357 end
357 end
358 end
358 end
359
359
360 def issues_to_csv(issues, project, query, options={})
360 def issues_to_csv(issues, project, query, options={})
361 decimal_separator = l(:general_csv_decimal_separator)
361 decimal_separator = l(:general_csv_decimal_separator)
362 encoding = l(:general_csv_encoding)
362 encoding = l(:general_csv_encoding)
363 columns = (options[:columns] == 'all' ? query.available_columns : query.columns)
363 columns = (options[:columns] == 'all' ? query.available_columns : query.columns)
364
364
365 export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
365 export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
366 # csv header fields
366 # csv header fields
367 csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
367 csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
368 (options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
368 (options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
369
369
370 # csv lines
370 # csv lines
371 issues.each do |issue|
371 issues.each do |issue|
372 col_values = columns.collect do |column|
372 col_values = columns.collect do |column|
373 s = if column.is_a?(QueryCustomFieldColumn)
373 s = if column.is_a?(QueryCustomFieldColumn)
374 cv = issue.custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
374 cv = issue.custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
375 show_value(cv)
375 show_value(cv)
376 else
376 else
377 value = column.value(issue)
377 value = column.value(issue)
378 if value.is_a?(Date)
378 if value.is_a?(Date)
379 format_date(value)
379 format_date(value)
380 elsif value.is_a?(Time)
380 elsif value.is_a?(Time)
381 format_time(value)
381 format_time(value)
382 elsif value.is_a?(Float)
382 elsif value.is_a?(Float)
383 ("%.2f" % value).gsub('.', decimal_separator)
383 ("%.2f" % value).gsub('.', decimal_separator)
384 else
384 else
385 value
385 value
386 end
386 end
387 end
387 end
388 s.to_s
388 s.to_s
389 end
389 end
390 csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } +
390 csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } +
391 (options[:description] ? [Redmine::CodesetUtil.from_utf8(issue.description, encoding)] : [])
391 (options[:description] ? [Redmine::CodesetUtil.from_utf8(issue.description, encoding)] : [])
392 end
392 end
393 end
393 end
394 export
394 export
395 end
395 end
396 end
396 end
@@ -1,94 +1,106
1 # encoding: utf-8
1 # encoding: utf-8
2 #
2 #
3 # Redmine - project management software
3 # Redmine - project management software
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 #
5 #
6 # This program is free software; you can redistribute it and/or
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
9 # of the License, or (at your option) any later version.
10 #
10 #
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
14 # GNU General Public License for more details.
15 #
15 #
16 # You should have received a copy of the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
19
20 module SettingsHelper
20 module SettingsHelper
21 def administration_settings_tabs
21 def administration_settings_tabs
22 tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
22 tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
23 {:name => 'display', :partial => 'settings/display', :label => :label_display},
23 {:name => 'display', :partial => 'settings/display', :label => :label_display},
24 {:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
24 {:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
25 {:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
25 {:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
26 {:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
26 {:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
27 {:name => 'notifications', :partial => 'settings/notifications', :label => :field_mail_notification},
27 {:name => 'notifications', :partial => 'settings/notifications', :label => :field_mail_notification},
28 {:name => 'mail_handler', :partial => 'settings/mail_handler', :label => :label_incoming_emails},
28 {:name => 'mail_handler', :partial => 'settings/mail_handler', :label => :label_incoming_emails},
29 {:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
29 {:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
30 ]
30 ]
31 end
31 end
32
32
33 def setting_select(setting, choices, options={})
33 def setting_select(setting, choices, options={})
34 if blank_text = options.delete(:blank)
34 if blank_text = options.delete(:blank)
35 choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
35 choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
36 end
36 end
37 setting_label(setting, options).html_safe +
37 setting_label(setting, options).html_safe +
38 select_tag("settings[#{setting}]",
38 select_tag("settings[#{setting}]",
39 options_for_select(choices, Setting.send(setting).to_s),
39 options_for_select(choices, Setting.send(setting).to_s),
40 options).html_safe
40 options).html_safe
41 end
41 end
42
42
43 def setting_multiselect(setting, choices, options={})
43 def setting_multiselect(setting, choices, options={})
44 setting_values = Setting.send(setting)
44 setting_values = Setting.send(setting)
45 setting_values = [] unless setting_values.is_a?(Array)
45 setting_values = [] unless setting_values.is_a?(Array)
46
46
47 content_tag("label", l(options[:label] || "setting_#{setting}")) +
47 content_tag("label", l(options[:label] || "setting_#{setting}")) +
48 hidden_field_tag("settings[#{setting}][]", '').html_safe +
48 hidden_field_tag("settings[#{setting}][]", '').html_safe +
49 choices.collect do |choice|
49 choices.collect do |choice|
50 text, value = (choice.is_a?(Array) ? choice : [choice, choice])
50 text, value = (choice.is_a?(Array) ? choice : [choice, choice])
51 content_tag(
51 content_tag(
52 'label',
52 'label',
53 check_box_tag(
53 check_box_tag(
54 "settings[#{setting}][]",
54 "settings[#{setting}][]",
55 value,
55 value,
56 Setting.send(setting).include?(value),
56 Setting.send(setting).include?(value),
57 :id => nil
57 :id => nil
58 ) + text.to_s,
58 ) + text.to_s,
59 :class => 'block'
59 :class => 'block'
60 )
60 )
61 end.join.html_safe
61 end.join.html_safe
62 end
62 end
63
63
64 def setting_text_field(setting, options={})
64 def setting_text_field(setting, options={})
65 setting_label(setting, options).html_safe +
65 setting_label(setting, options).html_safe +
66 text_field_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
66 text_field_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
67 end
67 end
68
68
69 def setting_text_area(setting, options={})
69 def setting_text_area(setting, options={})
70 setting_label(setting, options).html_safe +
70 setting_label(setting, options).html_safe +
71 text_area_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
71 text_area_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
72 end
72 end
73
73
74 def setting_check_box(setting, options={})
74 def setting_check_box(setting, options={})
75 setting_label(setting, options).html_safe +
75 setting_label(setting, options).html_safe +
76 hidden_field_tag("settings[#{setting}]", 0, :id => nil).html_safe +
76 hidden_field_tag("settings[#{setting}]", 0, :id => nil).html_safe +
77 check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options).html_safe
77 check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options).html_safe
78 end
78 end
79
79
80 def setting_label(setting, options={})
80 def setting_label(setting, options={})
81 label = options.delete(:label)
81 label = options.delete(:label)
82 label != false ? label_tag("settings_#{setting}", l(label || "setting_#{setting}")).html_safe : ''
82 label != false ? label_tag("settings_#{setting}", l(label || "setting_#{setting}")).html_safe : ''
83 end
83 end
84
84
85 # Renders a notification field for a Redmine::Notifiable option
85 # Renders a notification field for a Redmine::Notifiable option
86 def notification_field(notifiable)
86 def notification_field(notifiable)
87 return content_tag(:label,
87 return content_tag(:label,
88 check_box_tag('settings[notified_events][]',
88 check_box_tag('settings[notified_events][]',
89 notifiable.name,
89 notifiable.name,
90 Setting.notified_events.include?(notifiable.name), :id => nil).html_safe +
90 Setting.notified_events.include?(notifiable.name), :id => nil).html_safe +
91 l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
91 l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
92 :class => notifiable.parent.present? ? "parent" : '').html_safe
92 :class => notifiable.parent.present? ? "parent" : '').html_safe
93 end
93 end
94
95 def cross_project_subtasks_options
96 options = [
97 [:label_disabled, ''],
98 [:label_cross_project_system, 'system'],
99 [:label_cross_project_tree, 'tree'],
100 [:label_cross_project_hierarchy, 'hierarchy'],
101 [:label_cross_project_descendants, 'descendants']
102 ]
103
104 options.map {|label, value| [l(label), value.to_s]}
105 end
94 end
106 end
@@ -1,1333 +1,1354
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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
20
21 belongs_to :project
21 belongs_to :project
22 belongs_to :tracker
22 belongs_to :tracker
23 belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
23 belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
24 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
24 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
25 belongs_to :assigned_to, :class_name => 'Principal', :foreign_key => 'assigned_to_id'
25 belongs_to :assigned_to, :class_name => 'Principal', :foreign_key => 'assigned_to_id'
26 belongs_to :fixed_version, :class_name => 'Version', :foreign_key => 'fixed_version_id'
26 belongs_to :fixed_version, :class_name => 'Version', :foreign_key => 'fixed_version_id'
27 belongs_to :priority, :class_name => 'IssuePriority', :foreign_key => 'priority_id'
27 belongs_to :priority, :class_name => 'IssuePriority', :foreign_key => 'priority_id'
28 belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
28 belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
29
29
30 has_many :journals, :as => :journalized, :dependent => :destroy
30 has_many :journals, :as => :journalized, :dependent => :destroy
31 has_many :visible_journals,
31 has_many :visible_journals,
32 :class_name => 'Journal',
32 :class_name => 'Journal',
33 :as => :journalized,
33 :as => :journalized,
34 :conditions => Proc.new {
34 :conditions => Proc.new {
35 ["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false]
35 ["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false]
36 },
36 },
37 :readonly => true
37 :readonly => true
38
38
39 has_many :time_entries, :dependent => :delete_all
39 has_many :time_entries, :dependent => :delete_all
40 has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"
40 has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"
41
41
42 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
42 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
43 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
43 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
44
44
45 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
45 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
46 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
46 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
47 acts_as_customizable
47 acts_as_customizable
48 acts_as_watchable
48 acts_as_watchable
49 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
49 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
50 :include => [:project, :visible_journals],
50 :include => [:project, :visible_journals],
51 # sort by id so that limited eager loading doesn't break with postgresql
51 # sort by id so that limited eager loading doesn't break with postgresql
52 :order_column => "#{table_name}.id"
52 :order_column => "#{table_name}.id"
53 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
53 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
54 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
54 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
55 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
55 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
56
56
57 acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
57 acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
58 :author_key => :author_id
58 :author_key => :author_id
59
59
60 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
60 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
61
61
62 attr_reader :current_journal
62 attr_reader :current_journal
63 delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
63 delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
64
64
65 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
65 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
66
66
67 validates_length_of :subject, :maximum => 255
67 validates_length_of :subject, :maximum => 255
68 validates_inclusion_of :done_ratio, :in => 0..100
68 validates_inclusion_of :done_ratio, :in => 0..100
69 validates_numericality_of :estimated_hours, :allow_nil => true
69 validates_numericality_of :estimated_hours, :allow_nil => true
70 validate :validate_issue, :validate_required_fields
70 validate :validate_issue, :validate_required_fields
71
71
72 scope :visible,
72 scope :visible,
73 lambda {|*args| { :include => :project,
73 lambda {|*args| { :include => :project,
74 :conditions => Issue.visible_condition(args.shift || User.current, *args) } }
74 :conditions => Issue.visible_condition(args.shift || User.current, *args) } }
75
75
76 scope :open, lambda {|*args|
76 scope :open, lambda {|*args|
77 is_closed = args.size > 0 ? !args.first : false
77 is_closed = args.size > 0 ? !args.first : false
78 {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
78 {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
79 }
79 }
80
80
81 scope :recently_updated, :order => "#{Issue.table_name}.updated_on DESC"
81 scope :recently_updated, :order => "#{Issue.table_name}.updated_on DESC"
82 scope :on_active_project, :include => [:status, :project, :tracker],
82 scope :on_active_project, :include => [:status, :project, :tracker],
83 :conditions => ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"]
83 :conditions => ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"]
84
84
85 before_create :default_assign
85 before_create :default_assign
86 before_save :close_duplicates, :update_done_ratio_from_issue_status, :force_updated_on_change
86 before_save :close_duplicates, :update_done_ratio_from_issue_status, :force_updated_on_change
87 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
87 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
88 after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
88 after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
89 # Should be after_create but would be called before previous after_save callbacks
89 # Should be after_create but would be called before previous after_save callbacks
90 after_save :after_create_from_copy
90 after_save :after_create_from_copy
91 after_destroy :update_parent_attributes
91 after_destroy :update_parent_attributes
92
92
93 # Returns a SQL conditions string used to find all issues visible by the specified user
93 # Returns a SQL conditions string used to find all issues visible by the specified user
94 def self.visible_condition(user, options={})
94 def self.visible_condition(user, options={})
95 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
95 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
96 if user.logged?
96 if user.logged?
97 case role.issues_visibility
97 case role.issues_visibility
98 when 'all'
98 when 'all'
99 nil
99 nil
100 when 'default'
100 when 'default'
101 user_ids = [user.id] + user.groups.map(&:id)
101 user_ids = [user.id] + user.groups.map(&:id)
102 "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
102 "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
103 when 'own'
103 when 'own'
104 user_ids = [user.id] + user.groups.map(&:id)
104 user_ids = [user.id] + user.groups.map(&:id)
105 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
105 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
106 else
106 else
107 '1=0'
107 '1=0'
108 end
108 end
109 else
109 else
110 "(#{table_name}.is_private = #{connection.quoted_false})"
110 "(#{table_name}.is_private = #{connection.quoted_false})"
111 end
111 end
112 end
112 end
113 end
113 end
114
114
115 # Returns true if usr or current user is allowed to view the issue
115 # Returns true if usr or current user is allowed to view the issue
116 def visible?(usr=nil)
116 def visible?(usr=nil)
117 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
117 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
118 if user.logged?
118 if user.logged?
119 case role.issues_visibility
119 case role.issues_visibility
120 when 'all'
120 when 'all'
121 true
121 true
122 when 'default'
122 when 'default'
123 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
123 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
124 when 'own'
124 when 'own'
125 self.author == user || user.is_or_belongs_to?(assigned_to)
125 self.author == user || user.is_or_belongs_to?(assigned_to)
126 else
126 else
127 false
127 false
128 end
128 end
129 else
129 else
130 !self.is_private?
130 !self.is_private?
131 end
131 end
132 end
132 end
133 end
133 end
134
134
135 def initialize(attributes=nil, *args)
135 def initialize(attributes=nil, *args)
136 super
136 super
137 if new_record?
137 if new_record?
138 # set default values for new records only
138 # set default values for new records only
139 self.status ||= IssueStatus.default
139 self.status ||= IssueStatus.default
140 self.priority ||= IssuePriority.default
140 self.priority ||= IssuePriority.default
141 self.watcher_user_ids = []
141 self.watcher_user_ids = []
142 end
142 end
143 end
143 end
144
144
145 # AR#Persistence#destroy would raise and RecordNotFound exception
145 # AR#Persistence#destroy would raise and RecordNotFound exception
146 # if the issue was already deleted or updated (non matching lock_version).
146 # if the issue was already deleted or updated (non matching lock_version).
147 # This is a problem when bulk deleting issues or deleting a project
147 # This is a problem when bulk deleting issues or deleting a project
148 # (because an issue may already be deleted if its parent was deleted
148 # (because an issue may already be deleted if its parent was deleted
149 # first).
149 # first).
150 # The issue is reloaded by the nested_set before being deleted so
150 # The issue is reloaded by the nested_set before being deleted so
151 # the lock_version condition should not be an issue but we handle it.
151 # the lock_version condition should not be an issue but we handle it.
152 def destroy
152 def destroy
153 super
153 super
154 rescue ActiveRecord::RecordNotFound
154 rescue ActiveRecord::RecordNotFound
155 # Stale or already deleted
155 # Stale or already deleted
156 begin
156 begin
157 reload
157 reload
158 rescue ActiveRecord::RecordNotFound
158 rescue ActiveRecord::RecordNotFound
159 # The issue was actually already deleted
159 # The issue was actually already deleted
160 @destroyed = true
160 @destroyed = true
161 return freeze
161 return freeze
162 end
162 end
163 # The issue was stale, retry to destroy
163 # The issue was stale, retry to destroy
164 super
164 super
165 end
165 end
166
166
167 def reload(*args)
167 def reload(*args)
168 @workflow_rule_by_attribute = nil
168 @workflow_rule_by_attribute = nil
169 @assignable_versions = nil
169 @assignable_versions = nil
170 super
170 super
171 end
171 end
172
172
173 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
173 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
174 def available_custom_fields
174 def available_custom_fields
175 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
175 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
176 end
176 end
177
177
178 # Copies attributes from another issue, arg can be an id or an Issue
178 # Copies attributes from another issue, arg can be an id or an Issue
179 def copy_from(arg, options={})
179 def copy_from(arg, options={})
180 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
180 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
181 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
181 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
182 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
182 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
183 self.status = issue.status
183 self.status = issue.status
184 self.author = User.current
184 self.author = User.current
185 unless options[:attachments] == false
185 unless options[:attachments] == false
186 self.attachments = issue.attachments.map do |attachement|
186 self.attachments = issue.attachments.map do |attachement|
187 attachement.copy(:container => self)
187 attachement.copy(:container => self)
188 end
188 end
189 end
189 end
190 @copied_from = issue
190 @copied_from = issue
191 @copy_options = options
191 @copy_options = options
192 self
192 self
193 end
193 end
194
194
195 # Returns an unsaved copy of the issue
195 # Returns an unsaved copy of the issue
196 def copy(attributes=nil, copy_options={})
196 def copy(attributes=nil, copy_options={})
197 copy = self.class.new.copy_from(self, copy_options)
197 copy = self.class.new.copy_from(self, copy_options)
198 copy.attributes = attributes if attributes
198 copy.attributes = attributes if attributes
199 copy
199 copy
200 end
200 end
201
201
202 # Returns true if the issue is a copy
202 # Returns true if the issue is a copy
203 def copy?
203 def copy?
204 @copied_from.present?
204 @copied_from.present?
205 end
205 end
206
206
207 # Moves/copies an issue to a new project and tracker
207 # Moves/copies an issue to a new project and tracker
208 # Returns the moved/copied issue on success, false on failure
208 # Returns the moved/copied issue on success, false on failure
209 def move_to_project(new_project, new_tracker=nil, options={})
209 def move_to_project(new_project, new_tracker=nil, options={})
210 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
210 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
211
211
212 if options[:copy]
212 if options[:copy]
213 issue = self.copy
213 issue = self.copy
214 else
214 else
215 issue = self
215 issue = self
216 end
216 end
217
217
218 issue.init_journal(User.current, options[:notes])
218 issue.init_journal(User.current, options[:notes])
219
219
220 # Preserve previous behaviour
220 # Preserve previous behaviour
221 # #move_to_project doesn't change tracker automatically
221 # #move_to_project doesn't change tracker automatically
222 issue.send :project=, new_project, true
222 issue.send :project=, new_project, true
223 if new_tracker
223 if new_tracker
224 issue.tracker = new_tracker
224 issue.tracker = new_tracker
225 end
225 end
226 # Allow bulk setting of attributes on the issue
226 # Allow bulk setting of attributes on the issue
227 if options[:attributes]
227 if options[:attributes]
228 issue.attributes = options[:attributes]
228 issue.attributes = options[:attributes]
229 end
229 end
230
230
231 issue.save ? issue : false
231 issue.save ? issue : false
232 end
232 end
233
233
234 def status_id=(sid)
234 def status_id=(sid)
235 self.status = nil
235 self.status = nil
236 result = write_attribute(:status_id, sid)
236 result = write_attribute(:status_id, sid)
237 @workflow_rule_by_attribute = nil
237 @workflow_rule_by_attribute = nil
238 result
238 result
239 end
239 end
240
240
241 def priority_id=(pid)
241 def priority_id=(pid)
242 self.priority = nil
242 self.priority = nil
243 write_attribute(:priority_id, pid)
243 write_attribute(:priority_id, pid)
244 end
244 end
245
245
246 def category_id=(cid)
246 def category_id=(cid)
247 self.category = nil
247 self.category = nil
248 write_attribute(:category_id, cid)
248 write_attribute(:category_id, cid)
249 end
249 end
250
250
251 def fixed_version_id=(vid)
251 def fixed_version_id=(vid)
252 self.fixed_version = nil
252 self.fixed_version = nil
253 write_attribute(:fixed_version_id, vid)
253 write_attribute(:fixed_version_id, vid)
254 end
254 end
255
255
256 def tracker_id=(tid)
256 def tracker_id=(tid)
257 self.tracker = nil
257 self.tracker = nil
258 result = write_attribute(:tracker_id, tid)
258 result = write_attribute(:tracker_id, tid)
259 @custom_field_values = nil
259 @custom_field_values = nil
260 @workflow_rule_by_attribute = nil
260 @workflow_rule_by_attribute = nil
261 result
261 result
262 end
262 end
263
263
264 def project_id=(project_id)
264 def project_id=(project_id)
265 if project_id.to_s != self.project_id.to_s
265 if project_id.to_s != self.project_id.to_s
266 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
266 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
267 end
267 end
268 end
268 end
269
269
270 def project=(project, keep_tracker=false)
270 def project=(project, keep_tracker=false)
271 project_was = self.project
271 project_was = self.project
272 write_attribute(:project_id, project ? project.id : nil)
272 write_attribute(:project_id, project ? project.id : nil)
273 association_instance_set('project', project)
273 association_instance_set('project', project)
274 if project_was && project && project_was != project
274 if project_was && project && project_was != project
275 @assignable_versions = nil
275 @assignable_versions = nil
276
276
277 unless keep_tracker || project.trackers.include?(tracker)
277 unless keep_tracker || project.trackers.include?(tracker)
278 self.tracker = project.trackers.first
278 self.tracker = project.trackers.first
279 end
279 end
280 # Reassign to the category with same name if any
280 # Reassign to the category with same name if any
281 if category
281 if category
282 self.category = project.issue_categories.find_by_name(category.name)
282 self.category = project.issue_categories.find_by_name(category.name)
283 end
283 end
284 # Keep the fixed_version if it's still valid in the new_project
284 # Keep the fixed_version if it's still valid in the new_project
285 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
285 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
286 self.fixed_version = nil
286 self.fixed_version = nil
287 end
287 end
288 if parent && parent.project_id != project_id
288 # Clear the parent task if it's no longer valid
289 unless valid_parent_project?
289 self.parent_issue_id = nil
290 self.parent_issue_id = nil
290 end
291 end
291 @custom_field_values = nil
292 @custom_field_values = nil
292 end
293 end
293 end
294 end
294
295
295 def description=(arg)
296 def description=(arg)
296 if arg.is_a?(String)
297 if arg.is_a?(String)
297 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
298 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
298 end
299 end
299 write_attribute(:description, arg)
300 write_attribute(:description, arg)
300 end
301 end
301
302
302 # Overrides assign_attributes so that project and tracker get assigned first
303 # Overrides assign_attributes so that project and tracker get assigned first
303 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
304 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
304 return if new_attributes.nil?
305 return if new_attributes.nil?
305 attrs = new_attributes.dup
306 attrs = new_attributes.dup
306 attrs.stringify_keys!
307 attrs.stringify_keys!
307
308
308 %w(project project_id tracker tracker_id).each do |attr|
309 %w(project project_id tracker tracker_id).each do |attr|
309 if attrs.has_key?(attr)
310 if attrs.has_key?(attr)
310 send "#{attr}=", attrs.delete(attr)
311 send "#{attr}=", attrs.delete(attr)
311 end
312 end
312 end
313 end
313 send :assign_attributes_without_project_and_tracker_first, attrs, *args
314 send :assign_attributes_without_project_and_tracker_first, attrs, *args
314 end
315 end
315 # Do not redefine alias chain on reload (see #4838)
316 # Do not redefine alias chain on reload (see #4838)
316 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
317 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
317
318
318 def estimated_hours=(h)
319 def estimated_hours=(h)
319 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
320 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
320 end
321 end
321
322
322 safe_attributes 'project_id',
323 safe_attributes 'project_id',
323 :if => lambda {|issue, user|
324 :if => lambda {|issue, user|
324 if issue.new_record?
325 if issue.new_record?
325 issue.copy?
326 issue.copy?
326 elsif user.allowed_to?(:move_issues, issue.project)
327 elsif user.allowed_to?(:move_issues, issue.project)
327 projects = Issue.allowed_target_projects_on_move(user)
328 projects = Issue.allowed_target_projects_on_move(user)
328 projects.include?(issue.project) && projects.size > 1
329 projects.include?(issue.project) && projects.size > 1
329 end
330 end
330 }
331 }
331
332
332 safe_attributes 'tracker_id',
333 safe_attributes 'tracker_id',
333 'status_id',
334 'status_id',
334 'category_id',
335 'category_id',
335 'assigned_to_id',
336 'assigned_to_id',
336 'priority_id',
337 'priority_id',
337 'fixed_version_id',
338 'fixed_version_id',
338 'subject',
339 'subject',
339 'description',
340 'description',
340 'start_date',
341 'start_date',
341 'due_date',
342 'due_date',
342 'done_ratio',
343 'done_ratio',
343 'estimated_hours',
344 'estimated_hours',
344 'custom_field_values',
345 'custom_field_values',
345 'custom_fields',
346 'custom_fields',
346 'lock_version',
347 'lock_version',
347 'notes',
348 'notes',
348 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
349 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
349
350
350 safe_attributes 'status_id',
351 safe_attributes 'status_id',
351 'assigned_to_id',
352 'assigned_to_id',
352 'fixed_version_id',
353 'fixed_version_id',
353 'done_ratio',
354 'done_ratio',
354 'lock_version',
355 'lock_version',
355 'notes',
356 'notes',
356 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
357 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
357
358
358 safe_attributes 'notes',
359 safe_attributes 'notes',
359 :if => lambda {|issue, user| user.allowed_to?(:add_issue_notes, issue.project)}
360 :if => lambda {|issue, user| user.allowed_to?(:add_issue_notes, issue.project)}
360
361
361 safe_attributes 'private_notes',
362 safe_attributes 'private_notes',
362 :if => lambda {|issue, user| !issue.new_record? && user.allowed_to?(:set_notes_private, issue.project)}
363 :if => lambda {|issue, user| !issue.new_record? && user.allowed_to?(:set_notes_private, issue.project)}
363
364
364 safe_attributes 'watcher_user_ids',
365 safe_attributes 'watcher_user_ids',
365 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
366 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
366
367
367 safe_attributes 'is_private',
368 safe_attributes 'is_private',
368 :if => lambda {|issue, user|
369 :if => lambda {|issue, user|
369 user.allowed_to?(:set_issues_private, issue.project) ||
370 user.allowed_to?(:set_issues_private, issue.project) ||
370 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
371 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
371 }
372 }
372
373
373 safe_attributes 'parent_issue_id',
374 safe_attributes 'parent_issue_id',
374 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
375 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
375 user.allowed_to?(:manage_subtasks, issue.project)}
376 user.allowed_to?(:manage_subtasks, issue.project)}
376
377
377 def safe_attribute_names(user=nil)
378 def safe_attribute_names(user=nil)
378 names = super
379 names = super
379 names -= disabled_core_fields
380 names -= disabled_core_fields
380 names -= read_only_attribute_names(user)
381 names -= read_only_attribute_names(user)
381 names
382 names
382 end
383 end
383
384
384 # Safely sets attributes
385 # Safely sets attributes
385 # Should be called from controllers instead of #attributes=
386 # Should be called from controllers instead of #attributes=
386 # attr_accessible is too rough because we still want things like
387 # attr_accessible is too rough because we still want things like
387 # Issue.new(:project => foo) to work
388 # Issue.new(:project => foo) to work
388 def safe_attributes=(attrs, user=User.current)
389 def safe_attributes=(attrs, user=User.current)
389 return unless attrs.is_a?(Hash)
390 return unless attrs.is_a?(Hash)
390
391
391 attrs = attrs.dup
392 attrs = attrs.dup
392
393
393 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
394 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
394 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
395 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
395 if allowed_target_projects(user).collect(&:id).include?(p.to_i)
396 if allowed_target_projects(user).collect(&:id).include?(p.to_i)
396 self.project_id = p
397 self.project_id = p
397 end
398 end
398 end
399 end
399
400
400 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
401 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
401 self.tracker_id = t
402 self.tracker_id = t
402 end
403 end
403
404
404 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
405 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
405 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
406 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
406 self.status_id = s
407 self.status_id = s
407 end
408 end
408 end
409 end
409
410
410 attrs = delete_unsafe_attributes(attrs, user)
411 attrs = delete_unsafe_attributes(attrs, user)
411 return if attrs.empty?
412 return if attrs.empty?
412
413
413 unless leaf?
414 unless leaf?
414 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
415 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
415 end
416 end
416
417
417 if attrs['parent_issue_id'].present?
418 if attrs['parent_issue_id'].present?
418 attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i)
419 attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i)
419 end
420 end
420
421
421 if attrs['custom_field_values'].present?
422 if attrs['custom_field_values'].present?
422 attrs['custom_field_values'] = attrs['custom_field_values'].reject {|k, v| read_only_attribute_names(user).include? k.to_s}
423 attrs['custom_field_values'] = attrs['custom_field_values'].reject {|k, v| read_only_attribute_names(user).include? k.to_s}
423 end
424 end
424
425
425 if attrs['custom_fields'].present?
426 if attrs['custom_fields'].present?
426 attrs['custom_fields'] = attrs['custom_fields'].reject {|c| read_only_attribute_names(user).include? c['id'].to_s}
427 attrs['custom_fields'] = attrs['custom_fields'].reject {|c| read_only_attribute_names(user).include? c['id'].to_s}
427 end
428 end
428
429
429 # mass-assignment security bypass
430 # mass-assignment security bypass
430 assign_attributes attrs, :without_protection => true
431 assign_attributes attrs, :without_protection => true
431 end
432 end
432
433
433 def disabled_core_fields
434 def disabled_core_fields
434 tracker ? tracker.disabled_core_fields : []
435 tracker ? tracker.disabled_core_fields : []
435 end
436 end
436
437
437 # Returns the custom_field_values that can be edited by the given user
438 # Returns the custom_field_values that can be edited by the given user
438 def editable_custom_field_values(user=nil)
439 def editable_custom_field_values(user=nil)
439 custom_field_values.reject do |value|
440 custom_field_values.reject do |value|
440 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
441 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
441 end
442 end
442 end
443 end
443
444
444 # Returns the names of attributes that are read-only for user or the current user
445 # Returns the names of attributes that are read-only for user or the current user
445 # For users with multiple roles, the read-only fields are the intersection of
446 # For users with multiple roles, the read-only fields are the intersection of
446 # read-only fields of each role
447 # read-only fields of each role
447 # The result is an array of strings where sustom fields are represented with their ids
448 # The result is an array of strings where sustom fields are represented with their ids
448 #
449 #
449 # Examples:
450 # Examples:
450 # issue.read_only_attribute_names # => ['due_date', '2']
451 # issue.read_only_attribute_names # => ['due_date', '2']
451 # issue.read_only_attribute_names(user) # => []
452 # issue.read_only_attribute_names(user) # => []
452 def read_only_attribute_names(user=nil)
453 def read_only_attribute_names(user=nil)
453 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
454 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
454 end
455 end
455
456
456 # Returns the names of required attributes for user or the current user
457 # Returns the names of required attributes for user or the current user
457 # For users with multiple roles, the required fields are the intersection of
458 # For users with multiple roles, the required fields are the intersection of
458 # required fields of each role
459 # required fields of each role
459 # The result is an array of strings where sustom fields are represented with their ids
460 # The result is an array of strings where sustom fields are represented with their ids
460 #
461 #
461 # Examples:
462 # Examples:
462 # issue.required_attribute_names # => ['due_date', '2']
463 # issue.required_attribute_names # => ['due_date', '2']
463 # issue.required_attribute_names(user) # => []
464 # issue.required_attribute_names(user) # => []
464 def required_attribute_names(user=nil)
465 def required_attribute_names(user=nil)
465 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
466 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
466 end
467 end
467
468
468 # Returns true if the attribute is required for user
469 # Returns true if the attribute is required for user
469 def required_attribute?(name, user=nil)
470 def required_attribute?(name, user=nil)
470 required_attribute_names(user).include?(name.to_s)
471 required_attribute_names(user).include?(name.to_s)
471 end
472 end
472
473
473 # Returns a hash of the workflow rule by attribute for the given user
474 # Returns a hash of the workflow rule by attribute for the given user
474 #
475 #
475 # Examples:
476 # Examples:
476 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
477 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
477 def workflow_rule_by_attribute(user=nil)
478 def workflow_rule_by_attribute(user=nil)
478 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
479 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
479
480
480 user_real = user || User.current
481 user_real = user || User.current
481 roles = user_real.admin ? Role.all : user_real.roles_for_project(project)
482 roles = user_real.admin ? Role.all : user_real.roles_for_project(project)
482 return {} if roles.empty?
483 return {} if roles.empty?
483
484
484 result = {}
485 result = {}
485 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).all
486 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).all
486 if workflow_permissions.any?
487 if workflow_permissions.any?
487 workflow_rules = workflow_permissions.inject({}) do |h, wp|
488 workflow_rules = workflow_permissions.inject({}) do |h, wp|
488 h[wp.field_name] ||= []
489 h[wp.field_name] ||= []
489 h[wp.field_name] << wp.rule
490 h[wp.field_name] << wp.rule
490 h
491 h
491 end
492 end
492 workflow_rules.each do |attr, rules|
493 workflow_rules.each do |attr, rules|
493 next if rules.size < roles.size
494 next if rules.size < roles.size
494 uniq_rules = rules.uniq
495 uniq_rules = rules.uniq
495 if uniq_rules.size == 1
496 if uniq_rules.size == 1
496 result[attr] = uniq_rules.first
497 result[attr] = uniq_rules.first
497 else
498 else
498 result[attr] = 'required'
499 result[attr] = 'required'
499 end
500 end
500 end
501 end
501 end
502 end
502 @workflow_rule_by_attribute = result if user.nil?
503 @workflow_rule_by_attribute = result if user.nil?
503 result
504 result
504 end
505 end
505 private :workflow_rule_by_attribute
506 private :workflow_rule_by_attribute
506
507
507 def done_ratio
508 def done_ratio
508 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
509 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
509 status.default_done_ratio
510 status.default_done_ratio
510 else
511 else
511 read_attribute(:done_ratio)
512 read_attribute(:done_ratio)
512 end
513 end
513 end
514 end
514
515
515 def self.use_status_for_done_ratio?
516 def self.use_status_for_done_ratio?
516 Setting.issue_done_ratio == 'issue_status'
517 Setting.issue_done_ratio == 'issue_status'
517 end
518 end
518
519
519 def self.use_field_for_done_ratio?
520 def self.use_field_for_done_ratio?
520 Setting.issue_done_ratio == 'issue_field'
521 Setting.issue_done_ratio == 'issue_field'
521 end
522 end
522
523
523 def validate_issue
524 def validate_issue
524 if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
525 if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
525 errors.add :due_date, :not_a_date
526 errors.add :due_date, :not_a_date
526 end
527 end
527
528
528 if self.due_date and self.start_date and self.due_date < self.start_date
529 if self.due_date and self.start_date and self.due_date < self.start_date
529 errors.add :due_date, :greater_than_start_date
530 errors.add :due_date, :greater_than_start_date
530 end
531 end
531
532
532 if start_date && soonest_start && start_date < soonest_start
533 if start_date && soonest_start && start_date < soonest_start
533 errors.add :start_date, :invalid
534 errors.add :start_date, :invalid
534 end
535 end
535
536
536 if fixed_version
537 if fixed_version
537 if !assignable_versions.include?(fixed_version)
538 if !assignable_versions.include?(fixed_version)
538 errors.add :fixed_version_id, :inclusion
539 errors.add :fixed_version_id, :inclusion
539 elsif reopened? && fixed_version.closed?
540 elsif reopened? && fixed_version.closed?
540 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
541 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
541 end
542 end
542 end
543 end
543
544
544 # Checks that the issue can not be added/moved to a disabled tracker
545 # Checks that the issue can not be added/moved to a disabled tracker
545 if project && (tracker_id_changed? || project_id_changed?)
546 if project && (tracker_id_changed? || project_id_changed?)
546 unless project.trackers.include?(tracker)
547 unless project.trackers.include?(tracker)
547 errors.add :tracker_id, :inclusion
548 errors.add :tracker_id, :inclusion
548 end
549 end
549 end
550 end
550
551
551 # Checks parent issue assignment
552 # Checks parent issue assignment
552 if @parent_issue
553 if @parent_issue
553 if @parent_issue.project_id != project_id
554 if !valid_parent_project?(@parent_issue)
554 errors.add :parent_issue_id, :not_same_project
555 errors.add :parent_issue_id, :invalid
555 elsif !new_record?
556 elsif !new_record?
556 # moving an existing issue
557 # moving an existing issue
557 if @parent_issue.root_id != root_id
558 if @parent_issue.root_id != root_id
558 # we can always move to another tree
559 # we can always move to another tree
559 elsif move_possible?(@parent_issue)
560 elsif move_possible?(@parent_issue)
560 # move accepted inside tree
561 # move accepted inside tree
561 else
562 else
562 errors.add :parent_issue_id, :not_a_valid_parent
563 errors.add :parent_issue_id, :invalid
563 end
564 end
564 end
565 end
565 end
566 end
566 end
567 end
567
568
568 # Validates the issue against additional workflow requirements
569 # Validates the issue against additional workflow requirements
569 def validate_required_fields
570 def validate_required_fields
570 user = new_record? ? author : current_journal.try(:user)
571 user = new_record? ? author : current_journal.try(:user)
571
572
572 required_attribute_names(user).each do |attribute|
573 required_attribute_names(user).each do |attribute|
573 if attribute =~ /^\d+$/
574 if attribute =~ /^\d+$/
574 attribute = attribute.to_i
575 attribute = attribute.to_i
575 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
576 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
576 if v && v.value.blank?
577 if v && v.value.blank?
577 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
578 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
578 end
579 end
579 else
580 else
580 if respond_to?(attribute) && send(attribute).blank?
581 if respond_to?(attribute) && send(attribute).blank?
581 errors.add attribute, :blank
582 errors.add attribute, :blank
582 end
583 end
583 end
584 end
584 end
585 end
585 end
586 end
586
587
587 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
588 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
588 # even if the user turns off the setting later
589 # even if the user turns off the setting later
589 def update_done_ratio_from_issue_status
590 def update_done_ratio_from_issue_status
590 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
591 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
591 self.done_ratio = status.default_done_ratio
592 self.done_ratio = status.default_done_ratio
592 end
593 end
593 end
594 end
594
595
595 def init_journal(user, notes = "")
596 def init_journal(user, notes = "")
596 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
597 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
597 if new_record?
598 if new_record?
598 @current_journal.notify = false
599 @current_journal.notify = false
599 else
600 else
600 @attributes_before_change = attributes.dup
601 @attributes_before_change = attributes.dup
601 @custom_values_before_change = {}
602 @custom_values_before_change = {}
602 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
603 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
603 end
604 end
604 @current_journal
605 @current_journal
605 end
606 end
606
607
607 # Returns the id of the last journal or nil
608 # Returns the id of the last journal or nil
608 def last_journal_id
609 def last_journal_id
609 if new_record?
610 if new_record?
610 nil
611 nil
611 else
612 else
612 journals.maximum(:id)
613 journals.maximum(:id)
613 end
614 end
614 end
615 end
615
616
616 # Returns a scope for journals that have an id greater than journal_id
617 # Returns a scope for journals that have an id greater than journal_id
617 def journals_after(journal_id)
618 def journals_after(journal_id)
618 scope = journals.reorder("#{Journal.table_name}.id ASC")
619 scope = journals.reorder("#{Journal.table_name}.id ASC")
619 if journal_id.present?
620 if journal_id.present?
620 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
621 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
621 end
622 end
622 scope
623 scope
623 end
624 end
624
625
625 # Return true if the issue is closed, otherwise false
626 # Return true if the issue is closed, otherwise false
626 def closed?
627 def closed?
627 self.status.is_closed?
628 self.status.is_closed?
628 end
629 end
629
630
630 # Return true if the issue is being reopened
631 # Return true if the issue is being reopened
631 def reopened?
632 def reopened?
632 if !new_record? && status_id_changed?
633 if !new_record? && status_id_changed?
633 status_was = IssueStatus.find_by_id(status_id_was)
634 status_was = IssueStatus.find_by_id(status_id_was)
634 status_new = IssueStatus.find_by_id(status_id)
635 status_new = IssueStatus.find_by_id(status_id)
635 if status_was && status_new && status_was.is_closed? && !status_new.is_closed?
636 if status_was && status_new && status_was.is_closed? && !status_new.is_closed?
636 return true
637 return true
637 end
638 end
638 end
639 end
639 false
640 false
640 end
641 end
641
642
642 # Return true if the issue is being closed
643 # Return true if the issue is being closed
643 def closing?
644 def closing?
644 if !new_record? && status_id_changed?
645 if !new_record? && status_id_changed?
645 status_was = IssueStatus.find_by_id(status_id_was)
646 status_was = IssueStatus.find_by_id(status_id_was)
646 status_new = IssueStatus.find_by_id(status_id)
647 status_new = IssueStatus.find_by_id(status_id)
647 if status_was && status_new && !status_was.is_closed? && status_new.is_closed?
648 if status_was && status_new && !status_was.is_closed? && status_new.is_closed?
648 return true
649 return true
649 end
650 end
650 end
651 end
651 false
652 false
652 end
653 end
653
654
654 # Returns true if the issue is overdue
655 # Returns true if the issue is overdue
655 def overdue?
656 def overdue?
656 !due_date.nil? && (due_date < Date.today) && !status.is_closed?
657 !due_date.nil? && (due_date < Date.today) && !status.is_closed?
657 end
658 end
658
659
659 # Is the amount of work done less than it should for the due date
660 # Is the amount of work done less than it should for the due date
660 def behind_schedule?
661 def behind_schedule?
661 return false if start_date.nil? || due_date.nil?
662 return false if start_date.nil? || due_date.nil?
662 done_date = start_date + ((due_date - start_date+1)* done_ratio/100).floor
663 done_date = start_date + ((due_date - start_date+1)* done_ratio/100).floor
663 return done_date <= Date.today
664 return done_date <= Date.today
664 end
665 end
665
666
666 # Does this issue have children?
667 # Does this issue have children?
667 def children?
668 def children?
668 !leaf?
669 !leaf?
669 end
670 end
670
671
671 # Users the issue can be assigned to
672 # Users the issue can be assigned to
672 def assignable_users
673 def assignable_users
673 users = project.assignable_users
674 users = project.assignable_users
674 users << author if author
675 users << author if author
675 users << assigned_to if assigned_to
676 users << assigned_to if assigned_to
676 users.uniq.sort
677 users.uniq.sort
677 end
678 end
678
679
679 # Versions that the issue can be assigned to
680 # Versions that the issue can be assigned to
680 def assignable_versions
681 def assignable_versions
681 return @assignable_versions if @assignable_versions
682 return @assignable_versions if @assignable_versions
682
683
683 versions = project.shared_versions.open.all
684 versions = project.shared_versions.open.all
684 if fixed_version
685 if fixed_version
685 if fixed_version_id_changed?
686 if fixed_version_id_changed?
686 # nothing to do
687 # nothing to do
687 elsif project_id_changed?
688 elsif project_id_changed?
688 if project.shared_versions.include?(fixed_version)
689 if project.shared_versions.include?(fixed_version)
689 versions << fixed_version
690 versions << fixed_version
690 end
691 end
691 else
692 else
692 versions << fixed_version
693 versions << fixed_version
693 end
694 end
694 end
695 end
695 @assignable_versions = versions.uniq.sort
696 @assignable_versions = versions.uniq.sort
696 end
697 end
697
698
698 # Returns true if this issue is blocked by another issue that is still open
699 # Returns true if this issue is blocked by another issue that is still open
699 def blocked?
700 def blocked?
700 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
701 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
701 end
702 end
702
703
703 # Returns an array of statuses that user is able to apply
704 # Returns an array of statuses that user is able to apply
704 def new_statuses_allowed_to(user=User.current, include_default=false)
705 def new_statuses_allowed_to(user=User.current, include_default=false)
705 if new_record? && @copied_from
706 if new_record? && @copied_from
706 [IssueStatus.default, @copied_from.status].compact.uniq.sort
707 [IssueStatus.default, @copied_from.status].compact.uniq.sort
707 else
708 else
708 initial_status = nil
709 initial_status = nil
709 if new_record?
710 if new_record?
710 initial_status = IssueStatus.default
711 initial_status = IssueStatus.default
711 elsif status_id_was
712 elsif status_id_was
712 initial_status = IssueStatus.find_by_id(status_id_was)
713 initial_status = IssueStatus.find_by_id(status_id_was)
713 end
714 end
714 initial_status ||= status
715 initial_status ||= status
715
716
716 statuses = initial_status.find_new_statuses_allowed_to(
717 statuses = initial_status.find_new_statuses_allowed_to(
717 user.admin ? Role.all : user.roles_for_project(project),
718 user.admin ? Role.all : user.roles_for_project(project),
718 tracker,
719 tracker,
719 author == user,
720 author == user,
720 assigned_to_id_changed? ? assigned_to_id_was == user.id : assigned_to_id == user.id
721 assigned_to_id_changed? ? assigned_to_id_was == user.id : assigned_to_id == user.id
721 )
722 )
722 statuses << initial_status unless statuses.empty?
723 statuses << initial_status unless statuses.empty?
723 statuses << IssueStatus.default if include_default
724 statuses << IssueStatus.default if include_default
724 statuses = statuses.compact.uniq.sort
725 statuses = statuses.compact.uniq.sort
725 blocked? ? statuses.reject {|s| s.is_closed?} : statuses
726 blocked? ? statuses.reject {|s| s.is_closed?} : statuses
726 end
727 end
727 end
728 end
728
729
729 def assigned_to_was
730 def assigned_to_was
730 if assigned_to_id_changed? && assigned_to_id_was.present?
731 if assigned_to_id_changed? && assigned_to_id_was.present?
731 @assigned_to_was ||= User.find_by_id(assigned_to_id_was)
732 @assigned_to_was ||= User.find_by_id(assigned_to_id_was)
732 end
733 end
733 end
734 end
734
735
735 # Returns the users that should be notified
736 # Returns the users that should be notified
736 def notified_users
737 def notified_users
737 notified = []
738 notified = []
738 # Author and assignee are always notified unless they have been
739 # Author and assignee are always notified unless they have been
739 # locked or don't want to be notified
740 # locked or don't want to be notified
740 notified << author if author
741 notified << author if author
741 if assigned_to
742 if assigned_to
742 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
743 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
743 end
744 end
744 if assigned_to_was
745 if assigned_to_was
745 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
746 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
746 end
747 end
747 notified = notified.select {|u| u.active? && u.notify_about?(self)}
748 notified = notified.select {|u| u.active? && u.notify_about?(self)}
748
749
749 notified += project.notified_users
750 notified += project.notified_users
750 notified.uniq!
751 notified.uniq!
751 # Remove users that can not view the issue
752 # Remove users that can not view the issue
752 notified.reject! {|user| !visible?(user)}
753 notified.reject! {|user| !visible?(user)}
753 notified
754 notified
754 end
755 end
755
756
756 # Returns the email addresses that should be notified
757 # Returns the email addresses that should be notified
757 def recipients
758 def recipients
758 notified_users.collect(&:mail)
759 notified_users.collect(&:mail)
759 end
760 end
760
761
761 # Returns the number of hours spent on this issue
762 # Returns the number of hours spent on this issue
762 def spent_hours
763 def spent_hours
763 @spent_hours ||= time_entries.sum(:hours) || 0
764 @spent_hours ||= time_entries.sum(:hours) || 0
764 end
765 end
765
766
766 # Returns the total number of hours spent on this issue and its descendants
767 # Returns the total number of hours spent on this issue and its descendants
767 #
768 #
768 # Example:
769 # Example:
769 # spent_hours => 0.0
770 # spent_hours => 0.0
770 # spent_hours => 50.2
771 # spent_hours => 50.2
771 def total_spent_hours
772 def total_spent_hours
772 @total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
773 @total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
773 :joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").to_f || 0.0
774 :joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").to_f || 0.0
774 end
775 end
775
776
776 def relations
777 def relations
777 @relations ||= IssueRelations.new(self, (relations_from + relations_to).sort)
778 @relations ||= IssueRelations.new(self, (relations_from + relations_to).sort)
778 end
779 end
779
780
780 # Preloads relations for a collection of issues
781 # Preloads relations for a collection of issues
781 def self.load_relations(issues)
782 def self.load_relations(issues)
782 if issues.any?
783 if issues.any?
783 relations = IssueRelation.all(:conditions => ["issue_from_id IN (:ids) OR issue_to_id IN (:ids)", {:ids => issues.map(&:id)}])
784 relations = IssueRelation.all(:conditions => ["issue_from_id IN (:ids) OR issue_to_id IN (:ids)", {:ids => issues.map(&:id)}])
784 issues.each do |issue|
785 issues.each do |issue|
785 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
786 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
786 end
787 end
787 end
788 end
788 end
789 end
789
790
790 # Preloads visible spent time for a collection of issues
791 # Preloads visible spent time for a collection of issues
791 def self.load_visible_spent_hours(issues, user=User.current)
792 def self.load_visible_spent_hours(issues, user=User.current)
792 if issues.any?
793 if issues.any?
793 hours_by_issue_id = TimeEntry.visible(user).sum(:hours, :group => :issue_id)
794 hours_by_issue_id = TimeEntry.visible(user).sum(:hours, :group => :issue_id)
794 issues.each do |issue|
795 issues.each do |issue|
795 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
796 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
796 end
797 end
797 end
798 end
798 end
799 end
799
800
800 # Preloads visible relations for a collection of issues
801 # Preloads visible relations for a collection of issues
801 def self.load_visible_relations(issues, user=User.current)
802 def self.load_visible_relations(issues, user=User.current)
802 if issues.any?
803 if issues.any?
803 issue_ids = issues.map(&:id)
804 issue_ids = issues.map(&:id)
804 # Relations with issue_from in given issues and visible issue_to
805 # Relations with issue_from in given issues and visible issue_to
805 relations_from = IssueRelation.includes(:issue_to => [:status, :project]).where(visible_condition(user)).where(:issue_from_id => issue_ids).all
806 relations_from = IssueRelation.includes(:issue_to => [:status, :project]).where(visible_condition(user)).where(:issue_from_id => issue_ids).all
806 # Relations with issue_to in given issues and visible issue_from
807 # Relations with issue_to in given issues and visible issue_from
807 relations_to = IssueRelation.includes(:issue_from => [:status, :project]).where(visible_condition(user)).where(:issue_to_id => issue_ids).all
808 relations_to = IssueRelation.includes(:issue_from => [:status, :project]).where(visible_condition(user)).where(:issue_to_id => issue_ids).all
808
809
809 issues.each do |issue|
810 issues.each do |issue|
810 relations =
811 relations =
811 relations_from.select {|relation| relation.issue_from_id == issue.id} +
812 relations_from.select {|relation| relation.issue_from_id == issue.id} +
812 relations_to.select {|relation| relation.issue_to_id == issue.id}
813 relations_to.select {|relation| relation.issue_to_id == issue.id}
813
814
814 issue.instance_variable_set "@relations", IssueRelations.new(issue, relations.sort)
815 issue.instance_variable_set "@relations", IssueRelations.new(issue, relations.sort)
815 end
816 end
816 end
817 end
817 end
818 end
818
819
819 # Finds an issue relation given its id.
820 # Finds an issue relation given its id.
820 def find_relation(relation_id)
821 def find_relation(relation_id)
821 IssueRelation.find(relation_id, :conditions => ["issue_to_id = ? OR issue_from_id = ?", id, id])
822 IssueRelation.find(relation_id, :conditions => ["issue_to_id = ? OR issue_from_id = ?", id, id])
822 end
823 end
823
824
824 def all_dependent_issues(except=[])
825 def all_dependent_issues(except=[])
825 except << self
826 except << self
826 dependencies = []
827 dependencies = []
827 relations_from.each do |relation|
828 relations_from.each do |relation|
828 if relation.issue_to && !except.include?(relation.issue_to)
829 if relation.issue_to && !except.include?(relation.issue_to)
829 dependencies << relation.issue_to
830 dependencies << relation.issue_to
830 dependencies += relation.issue_to.all_dependent_issues(except)
831 dependencies += relation.issue_to.all_dependent_issues(except)
831 end
832 end
832 end
833 end
833 dependencies
834 dependencies
834 end
835 end
835
836
836 # Returns an array of issues that duplicate this one
837 # Returns an array of issues that duplicate this one
837 def duplicates
838 def duplicates
838 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
839 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
839 end
840 end
840
841
841 # Returns the due date or the target due date if any
842 # Returns the due date or the target due date if any
842 # Used on gantt chart
843 # Used on gantt chart
843 def due_before
844 def due_before
844 due_date || (fixed_version ? fixed_version.effective_date : nil)
845 due_date || (fixed_version ? fixed_version.effective_date : nil)
845 end
846 end
846
847
847 # Returns the time scheduled for this issue.
848 # Returns the time scheduled for this issue.
848 #
849 #
849 # Example:
850 # Example:
850 # Start Date: 2/26/09, End Date: 3/04/09
851 # Start Date: 2/26/09, End Date: 3/04/09
851 # duration => 6
852 # duration => 6
852 def duration
853 def duration
853 (start_date && due_date) ? due_date - start_date : 0
854 (start_date && due_date) ? due_date - start_date : 0
854 end
855 end
855
856
856 def soonest_start
857 def soonest_start
857 @soonest_start ||= (
858 @soonest_start ||= (
858 relations_to.collect{|relation| relation.successor_soonest_start} +
859 relations_to.collect{|relation| relation.successor_soonest_start} +
859 ancestors.collect(&:soonest_start)
860 ancestors.collect(&:soonest_start)
860 ).compact.max
861 ).compact.max
861 end
862 end
862
863
863 def reschedule_after(date)
864 def reschedule_after(date)
864 return if date.nil?
865 return if date.nil?
865 if leaf?
866 if leaf?
866 if start_date.nil? || start_date < date
867 if start_date.nil? || start_date < date
867 self.start_date, self.due_date = date, date + duration
868 self.start_date, self.due_date = date, date + duration
868 begin
869 begin
869 save
870 save
870 rescue ActiveRecord::StaleObjectError
871 rescue ActiveRecord::StaleObjectError
871 reload
872 reload
872 self.start_date, self.due_date = date, date + duration
873 self.start_date, self.due_date = date, date + duration
873 save
874 save
874 end
875 end
875 end
876 end
876 else
877 else
877 leaves.each do |leaf|
878 leaves.each do |leaf|
878 leaf.reschedule_after(date)
879 leaf.reschedule_after(date)
879 end
880 end
880 end
881 end
881 end
882 end
882
883
883 def <=>(issue)
884 def <=>(issue)
884 if issue.nil?
885 if issue.nil?
885 -1
886 -1
886 elsif root_id != issue.root_id
887 elsif root_id != issue.root_id
887 (root_id || 0) <=> (issue.root_id || 0)
888 (root_id || 0) <=> (issue.root_id || 0)
888 else
889 else
889 (lft || 0) <=> (issue.lft || 0)
890 (lft || 0) <=> (issue.lft || 0)
890 end
891 end
891 end
892 end
892
893
893 def to_s
894 def to_s
894 "#{tracker} ##{id}: #{subject}"
895 "#{tracker} ##{id}: #{subject}"
895 end
896 end
896
897
897 # Returns a string of css classes that apply to the issue
898 # Returns a string of css classes that apply to the issue
898 def css_classes
899 def css_classes
899 s = "issue status-#{status_id} priority-#{priority_id}"
900 s = "issue status-#{status_id} priority-#{priority_id}"
900 s << ' closed' if closed?
901 s << ' closed' if closed?
901 s << ' overdue' if overdue?
902 s << ' overdue' if overdue?
902 s << ' child' if child?
903 s << ' child' if child?
903 s << ' parent' unless leaf?
904 s << ' parent' unless leaf?
904 s << ' private' if is_private?
905 s << ' private' if is_private?
905 s << ' created-by-me' if User.current.logged? && author_id == User.current.id
906 s << ' created-by-me' if User.current.logged? && author_id == User.current.id
906 s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id
907 s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id
907 s
908 s
908 end
909 end
909
910
910 # Saves an issue and a time_entry from the parameters
911 # Saves an issue and a time_entry from the parameters
911 def save_issue_with_child_records(params, existing_time_entry=nil)
912 def save_issue_with_child_records(params, existing_time_entry=nil)
912 Issue.transaction do
913 Issue.transaction do
913 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, project)
914 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, project)
914 @time_entry = existing_time_entry || TimeEntry.new
915 @time_entry = existing_time_entry || TimeEntry.new
915 @time_entry.project = project
916 @time_entry.project = project
916 @time_entry.issue = self
917 @time_entry.issue = self
917 @time_entry.user = User.current
918 @time_entry.user = User.current
918 @time_entry.spent_on = User.current.today
919 @time_entry.spent_on = User.current.today
919 @time_entry.attributes = params[:time_entry]
920 @time_entry.attributes = params[:time_entry]
920 self.time_entries << @time_entry
921 self.time_entries << @time_entry
921 end
922 end
922
923
923 # TODO: Rename hook
924 # TODO: Rename hook
924 Redmine::Hook.call_hook(:controller_issues_edit_before_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
925 Redmine::Hook.call_hook(:controller_issues_edit_before_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
925 if save
926 if save
926 # TODO: Rename hook
927 # TODO: Rename hook
927 Redmine::Hook.call_hook(:controller_issues_edit_after_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
928 Redmine::Hook.call_hook(:controller_issues_edit_after_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
928 else
929 else
929 raise ActiveRecord::Rollback
930 raise ActiveRecord::Rollback
930 end
931 end
931 end
932 end
932 end
933 end
933
934
934 # Unassigns issues from +version+ if it's no longer shared with issue's project
935 # Unassigns issues from +version+ if it's no longer shared with issue's project
935 def self.update_versions_from_sharing_change(version)
936 def self.update_versions_from_sharing_change(version)
936 # Update issues assigned to the version
937 # Update issues assigned to the version
937 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
938 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
938 end
939 end
939
940
940 # Unassigns issues from versions that are no longer shared
941 # Unassigns issues from versions that are no longer shared
941 # after +project+ was moved
942 # after +project+ was moved
942 def self.update_versions_from_hierarchy_change(project)
943 def self.update_versions_from_hierarchy_change(project)
943 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
944 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
944 # Update issues of the moved projects and issues assigned to a version of a moved project
945 # Update issues of the moved projects and issues assigned to a version of a moved project
945 Issue.update_versions(["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", moved_project_ids, moved_project_ids])
946 Issue.update_versions(["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", moved_project_ids, moved_project_ids])
946 end
947 end
947
948
948 def parent_issue_id=(arg)
949 def parent_issue_id=(arg)
949 parent_issue_id = arg.blank? ? nil : arg.to_i
950 parent_issue_id = arg.blank? ? nil : arg.to_i
950 if parent_issue_id && @parent_issue = Issue.find_by_id(parent_issue_id)
951 if parent_issue_id && @parent_issue = Issue.find_by_id(parent_issue_id)
951 @parent_issue.id
952 @parent_issue.id
952 else
953 else
953 @parent_issue = nil
954 @parent_issue = nil
954 nil
955 nil
955 end
956 end
956 end
957 end
957
958
958 def parent_issue_id
959 def parent_issue_id
959 if instance_variable_defined? :@parent_issue
960 if instance_variable_defined? :@parent_issue
960 @parent_issue.nil? ? nil : @parent_issue.id
961 @parent_issue.nil? ? nil : @parent_issue.id
961 else
962 else
962 parent_id
963 parent_id
963 end
964 end
964 end
965 end
965
966
967 # Returns true if issue's project is a valid
968 # parent issue project
969 def valid_parent_project?(issue=parent)
970 return true if issue.nil? || issue.project_id == project_id
971
972 case Setting.cross_project_subtasks
973 when 'system'
974 true
975 when 'tree'
976 issue.project.root == project.root
977 when 'hierarchy'
978 issue.project.is_or_is_ancestor_of?(project) || issue.project.is_descendant_of?(project)
979 when 'descendants'
980 issue.project.is_or_is_ancestor_of?(project)
981 else
982 false
983 end
984 end
985
966 # Extracted from the ReportsController.
986 # Extracted from the ReportsController.
967 def self.by_tracker(project)
987 def self.by_tracker(project)
968 count_and_group_by(:project => project,
988 count_and_group_by(:project => project,
969 :field => 'tracker_id',
989 :field => 'tracker_id',
970 :joins => Tracker.table_name)
990 :joins => Tracker.table_name)
971 end
991 end
972
992
973 def self.by_version(project)
993 def self.by_version(project)
974 count_and_group_by(:project => project,
994 count_and_group_by(:project => project,
975 :field => 'fixed_version_id',
995 :field => 'fixed_version_id',
976 :joins => Version.table_name)
996 :joins => Version.table_name)
977 end
997 end
978
998
979 def self.by_priority(project)
999 def self.by_priority(project)
980 count_and_group_by(:project => project,
1000 count_and_group_by(:project => project,
981 :field => 'priority_id',
1001 :field => 'priority_id',
982 :joins => IssuePriority.table_name)
1002 :joins => IssuePriority.table_name)
983 end
1003 end
984
1004
985 def self.by_category(project)
1005 def self.by_category(project)
986 count_and_group_by(:project => project,
1006 count_and_group_by(:project => project,
987 :field => 'category_id',
1007 :field => 'category_id',
988 :joins => IssueCategory.table_name)
1008 :joins => IssueCategory.table_name)
989 end
1009 end
990
1010
991 def self.by_assigned_to(project)
1011 def self.by_assigned_to(project)
992 count_and_group_by(:project => project,
1012 count_and_group_by(:project => project,
993 :field => 'assigned_to_id',
1013 :field => 'assigned_to_id',
994 :joins => User.table_name)
1014 :joins => User.table_name)
995 end
1015 end
996
1016
997 def self.by_author(project)
1017 def self.by_author(project)
998 count_and_group_by(:project => project,
1018 count_and_group_by(:project => project,
999 :field => 'author_id',
1019 :field => 'author_id',
1000 :joins => User.table_name)
1020 :joins => User.table_name)
1001 end
1021 end
1002
1022
1003 def self.by_subproject(project)
1023 def self.by_subproject(project)
1004 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1024 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1005 s.is_closed as closed,
1025 s.is_closed as closed,
1006 #{Issue.table_name}.project_id as project_id,
1026 #{Issue.table_name}.project_id as project_id,
1007 count(#{Issue.table_name}.id) as total
1027 count(#{Issue.table_name}.id) as total
1008 from
1028 from
1009 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s
1029 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s
1010 where
1030 where
1011 #{Issue.table_name}.status_id=s.id
1031 #{Issue.table_name}.status_id=s.id
1012 and #{Issue.table_name}.project_id = #{Project.table_name}.id
1032 and #{Issue.table_name}.project_id = #{Project.table_name}.id
1013 and #{visible_condition(User.current, :project => project, :with_subprojects => true)}
1033 and #{visible_condition(User.current, :project => project, :with_subprojects => true)}
1014 and #{Issue.table_name}.project_id <> #{project.id}
1034 and #{Issue.table_name}.project_id <> #{project.id}
1015 group by s.id, s.is_closed, #{Issue.table_name}.project_id") if project.descendants.active.any?
1035 group by s.id, s.is_closed, #{Issue.table_name}.project_id") if project.descendants.active.any?
1016 end
1036 end
1017 # End ReportsController extraction
1037 # End ReportsController extraction
1018
1038
1019 # Returns an array of projects that user can assign the issue to
1039 # Returns an array of projects that user can assign the issue to
1020 def allowed_target_projects(user=User.current)
1040 def allowed_target_projects(user=User.current)
1021 if new_record?
1041 if new_record?
1022 Project.all(:conditions => Project.allowed_to_condition(user, :add_issues))
1042 Project.all(:conditions => Project.allowed_to_condition(user, :add_issues))
1023 else
1043 else
1024 self.class.allowed_target_projects_on_move(user)
1044 self.class.allowed_target_projects_on_move(user)
1025 end
1045 end
1026 end
1046 end
1027
1047
1028 # Returns an array of projects that user can move issues to
1048 # Returns an array of projects that user can move issues to
1029 def self.allowed_target_projects_on_move(user=User.current)
1049 def self.allowed_target_projects_on_move(user=User.current)
1030 Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
1050 Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
1031 end
1051 end
1032
1052
1033 private
1053 private
1034
1054
1035 def after_project_change
1055 def after_project_change
1036 # Update project_id on related time entries
1056 # Update project_id on related time entries
1037 TimeEntry.update_all(["project_id = ?", project_id], {:issue_id => id})
1057 TimeEntry.update_all(["project_id = ?", project_id], {:issue_id => id})
1038
1058
1039 # Delete issue relations
1059 # Delete issue relations
1040 unless Setting.cross_project_issue_relations?
1060 unless Setting.cross_project_issue_relations?
1041 relations_from.clear
1061 relations_from.clear
1042 relations_to.clear
1062 relations_to.clear
1043 end
1063 end
1044
1064
1045 # Move subtasks
1065 # Move subtasks that were in the same project
1046 children.each do |child|
1066 children.each do |child|
1067 next unless child.project_id == project_id_was
1047 # Change project and keep project
1068 # Change project and keep project
1048 child.send :project=, project, true
1069 child.send :project=, project, true
1049 unless child.save
1070 unless child.save
1050 raise ActiveRecord::Rollback
1071 raise ActiveRecord::Rollback
1051 end
1072 end
1052 end
1073 end
1053 end
1074 end
1054
1075
1055 # Callback for after the creation of an issue by copy
1076 # Callback for after the creation of an issue by copy
1056 # * adds a "copied to" relation with the copied issue
1077 # * adds a "copied to" relation with the copied issue
1057 # * copies subtasks from the copied issue
1078 # * copies subtasks from the copied issue
1058 def after_create_from_copy
1079 def after_create_from_copy
1059 return unless copy? && !@after_create_from_copy_handled
1080 return unless copy? && !@after_create_from_copy_handled
1060
1081
1061 if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
1082 if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
1062 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1083 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1063 unless relation.save
1084 unless relation.save
1064 logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
1085 logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
1065 end
1086 end
1066 end
1087 end
1067
1088
1068 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1089 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1069 @copied_from.children.each do |child|
1090 @copied_from.children.each do |child|
1070 unless child.visible?
1091 unless child.visible?
1071 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1092 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1072 logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
1093 logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
1073 next
1094 next
1074 end
1095 end
1075 copy = Issue.new.copy_from(child, @copy_options)
1096 copy = Issue.new.copy_from(child, @copy_options)
1076 copy.author = author
1097 copy.author = author
1077 copy.project = project
1098 copy.project = project
1078 copy.parent_issue_id = id
1099 copy.parent_issue_id = id
1079 # Children subtasks are copied recursively
1100 # Children subtasks are copied recursively
1080 unless copy.save
1101 unless copy.save
1081 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
1102 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
1082 end
1103 end
1083 end
1104 end
1084 end
1105 end
1085 @after_create_from_copy_handled = true
1106 @after_create_from_copy_handled = true
1086 end
1107 end
1087
1108
1088 def update_nested_set_attributes
1109 def update_nested_set_attributes
1089 if root_id.nil?
1110 if root_id.nil?
1090 # issue was just created
1111 # issue was just created
1091 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1112 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1092 set_default_left_and_right
1113 set_default_left_and_right
1093 Issue.update_all("root_id = #{root_id}, lft = #{lft}, rgt = #{rgt}", ["id = ?", id])
1114 Issue.update_all("root_id = #{root_id}, lft = #{lft}, rgt = #{rgt}", ["id = ?", id])
1094 if @parent_issue
1115 if @parent_issue
1095 move_to_child_of(@parent_issue)
1116 move_to_child_of(@parent_issue)
1096 end
1117 end
1097 reload
1118 reload
1098 elsif parent_issue_id != parent_id
1119 elsif parent_issue_id != parent_id
1099 former_parent_id = parent_id
1120 former_parent_id = parent_id
1100 # moving an existing issue
1121 # moving an existing issue
1101 if @parent_issue && @parent_issue.root_id == root_id
1122 if @parent_issue && @parent_issue.root_id == root_id
1102 # inside the same tree
1123 # inside the same tree
1103 move_to_child_of(@parent_issue)
1124 move_to_child_of(@parent_issue)
1104 else
1125 else
1105 # to another tree
1126 # to another tree
1106 unless root?
1127 unless root?
1107 move_to_right_of(root)
1128 move_to_right_of(root)
1108 reload
1129 reload
1109 end
1130 end
1110 old_root_id = root_id
1131 old_root_id = root_id
1111 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
1132 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
1112 target_maxright = nested_set_scope.maximum(right_column_name) || 0
1133 target_maxright = nested_set_scope.maximum(right_column_name) || 0
1113 offset = target_maxright + 1 - lft
1134 offset = target_maxright + 1 - lft
1114 Issue.update_all("root_id = #{root_id}, lft = lft + #{offset}, rgt = rgt + #{offset}",
1135 Issue.update_all("root_id = #{root_id}, lft = lft + #{offset}, rgt = rgt + #{offset}",
1115 ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt])
1136 ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt])
1116 self[left_column_name] = lft + offset
1137 self[left_column_name] = lft + offset
1117 self[right_column_name] = rgt + offset
1138 self[right_column_name] = rgt + offset
1118 if @parent_issue
1139 if @parent_issue
1119 move_to_child_of(@parent_issue)
1140 move_to_child_of(@parent_issue)
1120 end
1141 end
1121 end
1142 end
1122 reload
1143 reload
1123 # delete invalid relations of all descendants
1144 # delete invalid relations of all descendants
1124 self_and_descendants.each do |issue|
1145 self_and_descendants.each do |issue|
1125 issue.relations.each do |relation|
1146 issue.relations.each do |relation|
1126 relation.destroy unless relation.valid?
1147 relation.destroy unless relation.valid?
1127 end
1148 end
1128 end
1149 end
1129 # update former parent
1150 # update former parent
1130 recalculate_attributes_for(former_parent_id) if former_parent_id
1151 recalculate_attributes_for(former_parent_id) if former_parent_id
1131 end
1152 end
1132 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1153 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1133 end
1154 end
1134
1155
1135 def update_parent_attributes
1156 def update_parent_attributes
1136 recalculate_attributes_for(parent_id) if parent_id
1157 recalculate_attributes_for(parent_id) if parent_id
1137 end
1158 end
1138
1159
1139 def recalculate_attributes_for(issue_id)
1160 def recalculate_attributes_for(issue_id)
1140 if issue_id && p = Issue.find_by_id(issue_id)
1161 if issue_id && p = Issue.find_by_id(issue_id)
1141 # priority = highest priority of children
1162 # priority = highest priority of children
1142 if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :joins => :priority)
1163 if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :joins => :priority)
1143 p.priority = IssuePriority.find_by_position(priority_position)
1164 p.priority = IssuePriority.find_by_position(priority_position)
1144 end
1165 end
1145
1166
1146 # start/due dates = lowest/highest dates of children
1167 # start/due dates = lowest/highest dates of children
1147 p.start_date = p.children.minimum(:start_date)
1168 p.start_date = p.children.minimum(:start_date)
1148 p.due_date = p.children.maximum(:due_date)
1169 p.due_date = p.children.maximum(:due_date)
1149 if p.start_date && p.due_date && p.due_date < p.start_date
1170 if p.start_date && p.due_date && p.due_date < p.start_date
1150 p.start_date, p.due_date = p.due_date, p.start_date
1171 p.start_date, p.due_date = p.due_date, p.start_date
1151 end
1172 end
1152
1173
1153 # done ratio = weighted average ratio of leaves
1174 # done ratio = weighted average ratio of leaves
1154 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1175 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1155 leaves_count = p.leaves.count
1176 leaves_count = p.leaves.count
1156 if leaves_count > 0
1177 if leaves_count > 0
1157 average = p.leaves.average(:estimated_hours).to_f
1178 average = p.leaves.average(:estimated_hours).to_f
1158 if average == 0
1179 if average == 0
1159 average = 1
1180 average = 1
1160 end
1181 end
1161 done = p.leaves.sum("COALESCE(estimated_hours, #{average}) * (CASE WHEN is_closed = #{connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)", :joins => :status).to_f
1182 done = p.leaves.sum("COALESCE(estimated_hours, #{average}) * (CASE WHEN is_closed = #{connection.quoted_true} THEN 100 ELSE COALESCE(done_ratio, 0) END)", :joins => :status).to_f
1162 progress = done / (average * leaves_count)
1183 progress = done / (average * leaves_count)
1163 p.done_ratio = progress.round
1184 p.done_ratio = progress.round
1164 end
1185 end
1165 end
1186 end
1166
1187
1167 # estimate = sum of leaves estimates
1188 # estimate = sum of leaves estimates
1168 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1189 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1169 p.estimated_hours = nil if p.estimated_hours == 0.0
1190 p.estimated_hours = nil if p.estimated_hours == 0.0
1170
1191
1171 # ancestors will be recursively updated
1192 # ancestors will be recursively updated
1172 p.save(:validate => false)
1193 p.save(:validate => false)
1173 end
1194 end
1174 end
1195 end
1175
1196
1176 # Update issues so their versions are not pointing to a
1197 # Update issues so their versions are not pointing to a
1177 # fixed_version that is not shared with the issue's project
1198 # fixed_version that is not shared with the issue's project
1178 def self.update_versions(conditions=nil)
1199 def self.update_versions(conditions=nil)
1179 # Only need to update issues with a fixed_version from
1200 # Only need to update issues with a fixed_version from
1180 # a different project and that is not systemwide shared
1201 # a different project and that is not systemwide shared
1181 Issue.scoped(:conditions => conditions).all(
1202 Issue.scoped(:conditions => conditions).all(
1182 :conditions => "#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1203 :conditions => "#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1183 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1204 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1184 " AND #{Version.table_name}.sharing <> 'system'",
1205 " AND #{Version.table_name}.sharing <> 'system'",
1185 :include => [:project, :fixed_version]
1206 :include => [:project, :fixed_version]
1186 ).each do |issue|
1207 ).each do |issue|
1187 next if issue.project.nil? || issue.fixed_version.nil?
1208 next if issue.project.nil? || issue.fixed_version.nil?
1188 unless issue.project.shared_versions.include?(issue.fixed_version)
1209 unless issue.project.shared_versions.include?(issue.fixed_version)
1189 issue.init_journal(User.current)
1210 issue.init_journal(User.current)
1190 issue.fixed_version = nil
1211 issue.fixed_version = nil
1191 issue.save
1212 issue.save
1192 end
1213 end
1193 end
1214 end
1194 end
1215 end
1195
1216
1196 # Callback on file attachment
1217 # Callback on file attachment
1197 def attachment_added(obj)
1218 def attachment_added(obj)
1198 if @current_journal && !obj.new_record?
1219 if @current_journal && !obj.new_record?
1199 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1220 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1200 end
1221 end
1201 end
1222 end
1202
1223
1203 # Callback on attachment deletion
1224 # Callback on attachment deletion
1204 def attachment_removed(obj)
1225 def attachment_removed(obj)
1205 if @current_journal && !obj.new_record?
1226 if @current_journal && !obj.new_record?
1206 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1227 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1207 @current_journal.save
1228 @current_journal.save
1208 end
1229 end
1209 end
1230 end
1210
1231
1211 # Default assignment based on category
1232 # Default assignment based on category
1212 def default_assign
1233 def default_assign
1213 if assigned_to.nil? && category && category.assigned_to
1234 if assigned_to.nil? && category && category.assigned_to
1214 self.assigned_to = category.assigned_to
1235 self.assigned_to = category.assigned_to
1215 end
1236 end
1216 end
1237 end
1217
1238
1218 # Updates start/due dates of following issues
1239 # Updates start/due dates of following issues
1219 def reschedule_following_issues
1240 def reschedule_following_issues
1220 if start_date_changed? || due_date_changed?
1241 if start_date_changed? || due_date_changed?
1221 relations_from.each do |relation|
1242 relations_from.each do |relation|
1222 relation.set_issue_to_dates
1243 relation.set_issue_to_dates
1223 end
1244 end
1224 end
1245 end
1225 end
1246 end
1226
1247
1227 # Closes duplicates if the issue is being closed
1248 # Closes duplicates if the issue is being closed
1228 def close_duplicates
1249 def close_duplicates
1229 if closing?
1250 if closing?
1230 duplicates.each do |duplicate|
1251 duplicates.each do |duplicate|
1231 # Reload is need in case the duplicate was updated by a previous duplicate
1252 # Reload is need in case the duplicate was updated by a previous duplicate
1232 duplicate.reload
1253 duplicate.reload
1233 # Don't re-close it if it's already closed
1254 # Don't re-close it if it's already closed
1234 next if duplicate.closed?
1255 next if duplicate.closed?
1235 # Same user and notes
1256 # Same user and notes
1236 if @current_journal
1257 if @current_journal
1237 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1258 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1238 end
1259 end
1239 duplicate.update_attribute :status, self.status
1260 duplicate.update_attribute :status, self.status
1240 end
1261 end
1241 end
1262 end
1242 end
1263 end
1243
1264
1244 # Make sure updated_on is updated when adding a note
1265 # Make sure updated_on is updated when adding a note
1245 def force_updated_on_change
1266 def force_updated_on_change
1246 if @current_journal
1267 if @current_journal
1247 self.updated_on = current_time_from_proper_timezone
1268 self.updated_on = current_time_from_proper_timezone
1248 end
1269 end
1249 end
1270 end
1250
1271
1251 # Saves the changes in a Journal
1272 # Saves the changes in a Journal
1252 # Called after_save
1273 # Called after_save
1253 def create_journal
1274 def create_journal
1254 if @current_journal
1275 if @current_journal
1255 # attributes changes
1276 # attributes changes
1256 if @attributes_before_change
1277 if @attributes_before_change
1257 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on)).each {|c|
1278 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on)).each {|c|
1258 before = @attributes_before_change[c]
1279 before = @attributes_before_change[c]
1259 after = send(c)
1280 after = send(c)
1260 next if before == after || (before.blank? && after.blank?)
1281 next if before == after || (before.blank? && after.blank?)
1261 @current_journal.details << JournalDetail.new(:property => 'attr',
1282 @current_journal.details << JournalDetail.new(:property => 'attr',
1262 :prop_key => c,
1283 :prop_key => c,
1263 :old_value => before,
1284 :old_value => before,
1264 :value => after)
1285 :value => after)
1265 }
1286 }
1266 end
1287 end
1267 if @custom_values_before_change
1288 if @custom_values_before_change
1268 # custom fields changes
1289 # custom fields changes
1269 custom_field_values.each {|c|
1290 custom_field_values.each {|c|
1270 before = @custom_values_before_change[c.custom_field_id]
1291 before = @custom_values_before_change[c.custom_field_id]
1271 after = c.value
1292 after = c.value
1272 next if before == after || (before.blank? && after.blank?)
1293 next if before == after || (before.blank? && after.blank?)
1273
1294
1274 if before.is_a?(Array) || after.is_a?(Array)
1295 if before.is_a?(Array) || after.is_a?(Array)
1275 before = [before] unless before.is_a?(Array)
1296 before = [before] unless before.is_a?(Array)
1276 after = [after] unless after.is_a?(Array)
1297 after = [after] unless after.is_a?(Array)
1277
1298
1278 # values removed
1299 # values removed
1279 (before - after).reject(&:blank?).each do |value|
1300 (before - after).reject(&:blank?).each do |value|
1280 @current_journal.details << JournalDetail.new(:property => 'cf',
1301 @current_journal.details << JournalDetail.new(:property => 'cf',
1281 :prop_key => c.custom_field_id,
1302 :prop_key => c.custom_field_id,
1282 :old_value => value,
1303 :old_value => value,
1283 :value => nil)
1304 :value => nil)
1284 end
1305 end
1285 # values added
1306 # values added
1286 (after - before).reject(&:blank?).each do |value|
1307 (after - before).reject(&:blank?).each do |value|
1287 @current_journal.details << JournalDetail.new(:property => 'cf',
1308 @current_journal.details << JournalDetail.new(:property => 'cf',
1288 :prop_key => c.custom_field_id,
1309 :prop_key => c.custom_field_id,
1289 :old_value => nil,
1310 :old_value => nil,
1290 :value => value)
1311 :value => value)
1291 end
1312 end
1292 else
1313 else
1293 @current_journal.details << JournalDetail.new(:property => 'cf',
1314 @current_journal.details << JournalDetail.new(:property => 'cf',
1294 :prop_key => c.custom_field_id,
1315 :prop_key => c.custom_field_id,
1295 :old_value => before,
1316 :old_value => before,
1296 :value => after)
1317 :value => after)
1297 end
1318 end
1298 }
1319 }
1299 end
1320 end
1300 @current_journal.save
1321 @current_journal.save
1301 # reset current journal
1322 # reset current journal
1302 init_journal @current_journal.user, @current_journal.notes
1323 init_journal @current_journal.user, @current_journal.notes
1303 end
1324 end
1304 end
1325 end
1305
1326
1306 # Query generator for selecting groups of issue counts for a project
1327 # Query generator for selecting groups of issue counts for a project
1307 # based on specific criteria
1328 # based on specific criteria
1308 #
1329 #
1309 # Options
1330 # Options
1310 # * project - Project to search in.
1331 # * project - Project to search in.
1311 # * field - String. Issue field to key off of in the grouping.
1332 # * field - String. Issue field to key off of in the grouping.
1312 # * joins - String. The table name to join against.
1333 # * joins - String. The table name to join against.
1313 def self.count_and_group_by(options)
1334 def self.count_and_group_by(options)
1314 project = options.delete(:project)
1335 project = options.delete(:project)
1315 select_field = options.delete(:field)
1336 select_field = options.delete(:field)
1316 joins = options.delete(:joins)
1337 joins = options.delete(:joins)
1317
1338
1318 where = "#{Issue.table_name}.#{select_field}=j.id"
1339 where = "#{Issue.table_name}.#{select_field}=j.id"
1319
1340
1320 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1341 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1321 s.is_closed as closed,
1342 s.is_closed as closed,
1322 j.id as #{select_field},
1343 j.id as #{select_field},
1323 count(#{Issue.table_name}.id) as total
1344 count(#{Issue.table_name}.id) as total
1324 from
1345 from
1325 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s, #{joins} j
1346 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s, #{joins} j
1326 where
1347 where
1327 #{Issue.table_name}.status_id=s.id
1348 #{Issue.table_name}.status_id=s.id
1328 and #{where}
1349 and #{where}
1329 and #{Issue.table_name}.project_id=#{Project.table_name}.id
1350 and #{Issue.table_name}.project_id=#{Project.table_name}.id
1330 and #{visible_condition(User.current, :project => project)}
1351 and #{visible_condition(User.current, :project => project)}
1331 group by s.id, s.is_closed, j.id")
1352 group by s.id, s.is_closed, j.id")
1332 end
1353 end
1333 end
1354 end
@@ -1,73 +1,73
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
9 <% else %>
9 <% else %>
10 <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></p>
10 <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></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)}')" %>
46 <%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path}')" %>
47 <% end %>
47 <% end %>
48
48
49 <% if @issue.safe_attribute? 'start_date' %>
49 <% if @issue.safe_attribute? 'start_date' %>
50 <p><%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('start_date') %><%= calendar_for('issue_start_date') if @issue.leaf? %></p>
50 <p><%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('start_date') %><%= calendar_for('issue_start_date') if @issue.leaf? %></p>
51 <% end %>
51 <% end %>
52
52
53 <% if @issue.safe_attribute? 'due_date' %>
53 <% if @issue.safe_attribute? 'due_date' %>
54 <p><%= f.text_field :due_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('due_date') %><%= calendar_for('issue_due_date') if @issue.leaf? %></p>
54 <p><%= f.text_field :due_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('due_date') %><%= calendar_for('issue_due_date') if @issue.leaf? %></p>
55 <% end %>
55 <% end %>
56
56
57 <% if @issue.safe_attribute? 'estimated_hours' %>
57 <% if @issue.safe_attribute? 'estimated_hours' %>
58 <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
58 <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
59 <% end %>
59 <% end %>
60
60
61 <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
61 <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
62 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
62 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
63 <% end %>
63 <% end %>
64 </div>
64 </div>
65 </div>
65 </div>
66
66
67 <% if @issue.safe_attribute? 'custom_field_values' %>
67 <% if @issue.safe_attribute? 'custom_field_values' %>
68 <%= render :partial => 'issues/form_custom_fields' %>
68 <%= render :partial => 'issues/form_custom_fields' %>
69 <% end %>
69 <% end %>
70
70
71 <% end %>
71 <% end %>
72
72
73 <% include_calendar_headers_tags %>
73 <% include_calendar_headers_tags %>
@@ -1,29 +1,31
1 <%= form_tag({:action => 'edit', :tab => 'issues'}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
1 <%= form_tag({:action => 'edit', :tab => 'issues'}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
2
2
3 <div class="box tabular settings">
3 <div class="box tabular settings">
4 <p><%= setting_check_box :cross_project_issue_relations %></p>
4 <p><%= setting_check_box :cross_project_issue_relations %></p>
5
5
6 <p><%= setting_select :cross_project_subtasks, cross_project_subtasks_options %></p>
7
6 <p><%= setting_check_box :issue_group_assignment %></p>
8 <p><%= setting_check_box :issue_group_assignment %></p>
7
9
8 <p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
10 <p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
9
11
10 <p><%= setting_check_box :display_subprojects_issues %></p>
12 <p><%= setting_check_box :display_subprojects_issues %></p>
11
13
12 <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
14 <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
13
15
14 <p><%= setting_text_field :issues_export_limit, :size => 6 %></p>
16 <p><%= setting_text_field :issues_export_limit, :size => 6 %></p>
15
17
16 <p><%= setting_text_field :gantt_items_limit, :size => 6 %></p>
18 <p><%= setting_text_field :gantt_items_limit, :size => 6 %></p>
17 </div>
19 </div>
18
20
19 <fieldset class="box">
21 <fieldset class="box">
20 <legend><%= l(:setting_issue_list_default_columns) %></legend>
22 <legend><%= l(:setting_issue_list_default_columns) %></legend>
21 <%= render :partial => 'queries/columns',
23 <%= render :partial => 'queries/columns',
22 :locals => {
24 :locals => {
23 :query => Query.new(:column_names => Setting.issue_list_default_columns),
25 :query => Query.new(:column_names => Setting.issue_list_default_columns),
24 :tag_name => 'settings[issue_list_default_columns][]'
26 :tag_name => 'settings[issue_list_default_columns][]'
25 } %>
27 } %>
26 </fieldset>
28 </fieldset>
27
29
28 <%= submit_tag l(:button_save) %>
30 <%= submit_tag l(:button_save) %>
29 <% end %>
31 <% end %>
@@ -1,1072 +1,1073
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
132
133 actionview_instancetag_blank_option: Please select
133 actionview_instancetag_blank_option: Please select
134
134
135 general_text_No: 'No'
135 general_text_No: 'No'
136 general_text_Yes: 'Yes'
136 general_text_Yes: 'Yes'
137 general_text_no: 'no'
137 general_text_no: 'no'
138 general_text_yes: 'yes'
138 general_text_yes: 'yes'
139 general_lang_name: 'English'
139 general_lang_name: 'English'
140 general_csv_separator: ','
140 general_csv_separator: ','
141 general_csv_decimal_separator: '.'
141 general_csv_decimal_separator: '.'
142 general_csv_encoding: ISO-8859-1
142 general_csv_encoding: ISO-8859-1
143 general_pdf_encoding: UTF-8
143 general_pdf_encoding: UTF-8
144 general_first_day_of_week: '7'
144 general_first_day_of_week: '7'
145
145
146 notice_account_updated: Account was successfully updated.
146 notice_account_updated: Account was successfully updated.
147 notice_account_invalid_creditentials: Invalid user or password
147 notice_account_invalid_creditentials: Invalid user or password
148 notice_account_password_updated: Password was successfully updated.
148 notice_account_password_updated: Password was successfully updated.
149 notice_account_wrong_password: Wrong password
149 notice_account_wrong_password: Wrong password
150 notice_account_register_done: Account was successfully created. To activate your account, click on the link that was emailed to you.
150 notice_account_register_done: Account was successfully created. To activate your account, click on the link that was emailed to you.
151 notice_account_unknown_email: Unknown user.
151 notice_account_unknown_email: Unknown user.
152 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
152 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
153 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
153 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
154 notice_account_activated: Your account has been activated. You can now log in.
154 notice_account_activated: Your account has been activated. You can now log in.
155 notice_successful_create: Successful creation.
155 notice_successful_create: Successful creation.
156 notice_successful_update: Successful update.
156 notice_successful_update: Successful update.
157 notice_successful_delete: Successful deletion.
157 notice_successful_delete: Successful deletion.
158 notice_successful_connection: Successful connection.
158 notice_successful_connection: Successful connection.
159 notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
159 notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
160 notice_locking_conflict: Data has been updated by another user.
160 notice_locking_conflict: Data has been updated by another user.
161 notice_not_authorized: You are not authorized to access this page.
161 notice_not_authorized: You are not authorized to access this page.
162 notice_not_authorized_archived_project: The project you're trying to access has been archived.
162 notice_not_authorized_archived_project: The project you're trying to access has been archived.
163 notice_email_sent: "An email was sent to %{value}"
163 notice_email_sent: "An email was sent to %{value}"
164 notice_email_error: "An error occurred while sending mail (%{value})"
164 notice_email_error: "An error occurred while sending mail (%{value})"
165 notice_feeds_access_key_reseted: Your RSS access key was reset.
165 notice_feeds_access_key_reseted: Your RSS access key was reset.
166 notice_api_access_key_reseted: Your API access key was reset.
166 notice_api_access_key_reseted: Your API access key was reset.
167 notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}."
167 notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}."
168 notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}."
168 notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}."
169 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
169 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
170 notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit."
170 notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit."
171 notice_account_pending: "Your account was created and is now pending administrator approval."
171 notice_account_pending: "Your account was created and is now pending administrator approval."
172 notice_default_data_loaded: Default configuration successfully loaded.
172 notice_default_data_loaded: Default configuration successfully loaded.
173 notice_unable_delete_version: Unable to delete version.
173 notice_unable_delete_version: Unable to delete version.
174 notice_unable_delete_time_entry: Unable to delete time log entry.
174 notice_unable_delete_time_entry: Unable to delete time log entry.
175 notice_issue_done_ratios_updated: Issue done ratios updated.
175 notice_issue_done_ratios_updated: Issue done ratios updated.
176 notice_gantt_chart_truncated: "The chart was truncated because it exceeds the maximum number of items that can be displayed (%{max})"
176 notice_gantt_chart_truncated: "The chart was truncated because it exceeds the maximum number of items that can be displayed (%{max})"
177 notice_issue_successful_create: "Issue %{id} created."
177 notice_issue_successful_create: "Issue %{id} created."
178 notice_issue_update_conflict: "The issue has been updated by an other user while you were editing it."
178 notice_issue_update_conflict: "The issue has been updated by an other user while you were editing it."
179 notice_account_deleted: "Your account has been permanently deleted."
179 notice_account_deleted: "Your account has been permanently deleted."
180 notice_user_successful_create: "User %{id} created."
180 notice_user_successful_create: "User %{id} created."
181
181
182 error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
182 error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
183 error_scm_not_found: "The entry or revision was not found in the repository."
183 error_scm_not_found: "The entry or revision was not found in the repository."
184 error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
184 error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
185 error_scm_annotate: "The entry does not exist or cannot be annotated."
185 error_scm_annotate: "The entry does not exist or cannot be annotated."
186 error_scm_annotate_big_text_file: "The entry cannot be annotated, as it exceeds the maximum text file size."
186 error_scm_annotate_big_text_file: "The entry cannot be annotated, as it exceeds the maximum text file size."
187 error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
187 error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
188 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
188 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
189 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
189 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
190 error_can_not_delete_custom_field: Unable to delete custom field
190 error_can_not_delete_custom_field: Unable to delete custom field
191 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
191 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
192 error_can_not_remove_role: "This role is in use and cannot be deleted."
192 error_can_not_remove_role: "This role is in use and cannot be deleted."
193 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version cannot be reopened'
193 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version cannot be reopened'
194 error_can_not_archive_project: This project cannot be archived
194 error_can_not_archive_project: This project cannot be archived
195 error_issue_done_ratios_not_updated: "Issue done ratios not updated."
195 error_issue_done_ratios_not_updated: "Issue done ratios not updated."
196 error_workflow_copy_source: 'Please select a source tracker or role'
196 error_workflow_copy_source: 'Please select a source tracker or role'
197 error_workflow_copy_target: 'Please select target tracker(s) and role(s)'
197 error_workflow_copy_target: 'Please select target tracker(s) and role(s)'
198 error_unable_delete_issue_status: 'Unable to delete issue status'
198 error_unable_delete_issue_status: 'Unable to delete issue status'
199 error_unable_to_connect: "Unable to connect (%{value})"
199 error_unable_to_connect: "Unable to connect (%{value})"
200 error_attachment_too_big: "This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size})"
200 error_attachment_too_big: "This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size})"
201 error_session_expired: "Your session has expired. Please login again."
201 error_session_expired: "Your session has expired. Please login again."
202 warning_attachments_not_saved: "%{count} file(s) could not be saved."
202 warning_attachments_not_saved: "%{count} file(s) could not be saved."
203
203
204 mail_subject_lost_password: "Your %{value} password"
204 mail_subject_lost_password: "Your %{value} password"
205 mail_body_lost_password: 'To change your password, click on the following link:'
205 mail_body_lost_password: 'To change your password, click on the following link:'
206 mail_subject_register: "Your %{value} account activation"
206 mail_subject_register: "Your %{value} account activation"
207 mail_body_register: 'To activate your account, click on the following link:'
207 mail_body_register: 'To activate your account, click on the following link:'
208 mail_body_account_information_external: "You can use your %{value} account to log in."
208 mail_body_account_information_external: "You can use your %{value} account to log in."
209 mail_body_account_information: Your account information
209 mail_body_account_information: Your account information
210 mail_subject_account_activation_request: "%{value} account activation request"
210 mail_subject_account_activation_request: "%{value} account activation request"
211 mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
211 mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
212 mail_subject_reminder: "%{count} issue(s) due in the next %{days} days"
212 mail_subject_reminder: "%{count} issue(s) due in the next %{days} days"
213 mail_body_reminder: "%{count} issue(s) that are assigned to you are due in the next %{days} days:"
213 mail_body_reminder: "%{count} issue(s) that are assigned to you are due in the next %{days} days:"
214 mail_subject_wiki_content_added: "'%{id}' wiki page has been added"
214 mail_subject_wiki_content_added: "'%{id}' wiki page has been added"
215 mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
215 mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
216 mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
216 mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
217 mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
217 mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
218
218
219 gui_validation_error: 1 error
219 gui_validation_error: 1 error
220 gui_validation_error_plural: "%{count} errors"
220 gui_validation_error_plural: "%{count} errors"
221
221
222 field_name: Name
222 field_name: Name
223 field_description: Description
223 field_description: Description
224 field_summary: Summary
224 field_summary: Summary
225 field_is_required: Required
225 field_is_required: Required
226 field_firstname: First name
226 field_firstname: First name
227 field_lastname: Last name
227 field_lastname: Last name
228 field_mail: Email
228 field_mail: Email
229 field_filename: File
229 field_filename: File
230 field_filesize: Size
230 field_filesize: Size
231 field_downloads: Downloads
231 field_downloads: Downloads
232 field_author: Author
232 field_author: Author
233 field_created_on: Created
233 field_created_on: Created
234 field_updated_on: Updated
234 field_updated_on: Updated
235 field_field_format: Format
235 field_field_format: Format
236 field_is_for_all: For all projects
236 field_is_for_all: For all projects
237 field_possible_values: Possible values
237 field_possible_values: Possible values
238 field_regexp: Regular expression
238 field_regexp: Regular expression
239 field_min_length: Minimum length
239 field_min_length: Minimum length
240 field_max_length: Maximum length
240 field_max_length: Maximum length
241 field_value: Value
241 field_value: Value
242 field_category: Category
242 field_category: Category
243 field_title: Title
243 field_title: Title
244 field_project: Project
244 field_project: Project
245 field_issue: Issue
245 field_issue: Issue
246 field_status: Status
246 field_status: Status
247 field_notes: Notes
247 field_notes: Notes
248 field_is_closed: Issue closed
248 field_is_closed: Issue closed
249 field_is_default: Default value
249 field_is_default: Default value
250 field_tracker: Tracker
250 field_tracker: Tracker
251 field_subject: Subject
251 field_subject: Subject
252 field_due_date: Due date
252 field_due_date: Due date
253 field_assigned_to: Assignee
253 field_assigned_to: Assignee
254 field_priority: Priority
254 field_priority: Priority
255 field_fixed_version: Target version
255 field_fixed_version: Target version
256 field_user: User
256 field_user: User
257 field_principal: Principal
257 field_principal: Principal
258 field_role: Role
258 field_role: Role
259 field_homepage: Homepage
259 field_homepage: Homepage
260 field_is_public: Public
260 field_is_public: Public
261 field_parent: Subproject of
261 field_parent: Subproject of
262 field_is_in_roadmap: Issues displayed in roadmap
262 field_is_in_roadmap: Issues displayed in roadmap
263 field_login: Login
263 field_login: Login
264 field_mail_notification: Email notifications
264 field_mail_notification: Email notifications
265 field_admin: Administrator
265 field_admin: Administrator
266 field_last_login_on: Last connection
266 field_last_login_on: Last connection
267 field_language: Language
267 field_language: Language
268 field_effective_date: Date
268 field_effective_date: Date
269 field_password: Password
269 field_password: Password
270 field_new_password: New password
270 field_new_password: New password
271 field_password_confirmation: Confirmation
271 field_password_confirmation: Confirmation
272 field_version: Version
272 field_version: Version
273 field_type: Type
273 field_type: Type
274 field_host: Host
274 field_host: Host
275 field_port: Port
275 field_port: Port
276 field_account: Account
276 field_account: Account
277 field_base_dn: Base DN
277 field_base_dn: Base DN
278 field_attr_login: Login attribute
278 field_attr_login: Login attribute
279 field_attr_firstname: Firstname attribute
279 field_attr_firstname: Firstname attribute
280 field_attr_lastname: Lastname attribute
280 field_attr_lastname: Lastname attribute
281 field_attr_mail: Email attribute
281 field_attr_mail: Email attribute
282 field_onthefly: On-the-fly user creation
282 field_onthefly: On-the-fly user creation
283 field_start_date: Start date
283 field_start_date: Start date
284 field_done_ratio: "% Done"
284 field_done_ratio: "% Done"
285 field_auth_source: Authentication mode
285 field_auth_source: Authentication mode
286 field_hide_mail: Hide my email address
286 field_hide_mail: Hide my email address
287 field_comments: Comment
287 field_comments: Comment
288 field_url: URL
288 field_url: URL
289 field_start_page: Start page
289 field_start_page: Start page
290 field_subproject: Subproject
290 field_subproject: Subproject
291 field_hours: Hours
291 field_hours: Hours
292 field_activity: Activity
292 field_activity: Activity
293 field_spent_on: Date
293 field_spent_on: Date
294 field_identifier: Identifier
294 field_identifier: Identifier
295 field_is_filter: Used as a filter
295 field_is_filter: Used as a filter
296 field_issue_to: Related issue
296 field_issue_to: Related issue
297 field_delay: Delay
297 field_delay: Delay
298 field_assignable: Issues can be assigned to this role
298 field_assignable: Issues can be assigned to this role
299 field_redirect_existing_links: Redirect existing links
299 field_redirect_existing_links: Redirect existing links
300 field_estimated_hours: Estimated time
300 field_estimated_hours: Estimated time
301 field_column_names: Columns
301 field_column_names: Columns
302 field_time_entries: Log time
302 field_time_entries: Log time
303 field_time_zone: Time zone
303 field_time_zone: Time zone
304 field_searchable: Searchable
304 field_searchable: Searchable
305 field_default_value: Default value
305 field_default_value: Default value
306 field_comments_sorting: Display comments
306 field_comments_sorting: Display comments
307 field_parent_title: Parent page
307 field_parent_title: Parent page
308 field_editable: Editable
308 field_editable: Editable
309 field_watcher: Watcher
309 field_watcher: Watcher
310 field_identity_url: OpenID URL
310 field_identity_url: OpenID URL
311 field_content: Content
311 field_content: Content
312 field_group_by: Group results by
312 field_group_by: Group results by
313 field_sharing: Sharing
313 field_sharing: Sharing
314 field_parent_issue: Parent task
314 field_parent_issue: Parent task
315 field_member_of_group: "Assignee's group"
315 field_member_of_group: "Assignee's group"
316 field_assigned_to_role: "Assignee's role"
316 field_assigned_to_role: "Assignee's role"
317 field_text: Text field
317 field_text: Text field
318 field_visible: Visible
318 field_visible: Visible
319 field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
319 field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
320 field_issues_visibility: Issues visibility
320 field_issues_visibility: Issues visibility
321 field_is_private: Private
321 field_is_private: Private
322 field_commit_logs_encoding: Commit messages encoding
322 field_commit_logs_encoding: Commit messages encoding
323 field_scm_path_encoding: Path encoding
323 field_scm_path_encoding: Path encoding
324 field_path_to_repository: Path to repository
324 field_path_to_repository: Path to repository
325 field_root_directory: Root directory
325 field_root_directory: Root directory
326 field_cvsroot: CVSROOT
326 field_cvsroot: CVSROOT
327 field_cvs_module: Module
327 field_cvs_module: Module
328 field_repository_is_default: Main repository
328 field_repository_is_default: Main repository
329 field_multiple: Multiple values
329 field_multiple: Multiple values
330 field_auth_source_ldap_filter: LDAP filter
330 field_auth_source_ldap_filter: LDAP filter
331 field_core_fields: Standard fields
331 field_core_fields: Standard fields
332 field_timeout: "Timeout (in seconds)"
332 field_timeout: "Timeout (in seconds)"
333 field_board_parent: Parent forum
333 field_board_parent: Parent forum
334 field_private_notes: Private notes
334 field_private_notes: Private notes
335
335
336 setting_app_title: Application title
336 setting_app_title: Application title
337 setting_app_subtitle: Application subtitle
337 setting_app_subtitle: Application subtitle
338 setting_welcome_text: Welcome text
338 setting_welcome_text: Welcome text
339 setting_default_language: Default language
339 setting_default_language: Default language
340 setting_login_required: Authentication required
340 setting_login_required: Authentication required
341 setting_self_registration: Self-registration
341 setting_self_registration: Self-registration
342 setting_attachment_max_size: Maximum attachment size
342 setting_attachment_max_size: Maximum attachment size
343 setting_issues_export_limit: Issues export limit
343 setting_issues_export_limit: Issues export limit
344 setting_mail_from: Emission email address
344 setting_mail_from: Emission email address
345 setting_bcc_recipients: Blind carbon copy recipients (bcc)
345 setting_bcc_recipients: Blind carbon copy recipients (bcc)
346 setting_plain_text_mail: Plain text mail (no HTML)
346 setting_plain_text_mail: Plain text mail (no HTML)
347 setting_host_name: Host name and path
347 setting_host_name: Host name and path
348 setting_text_formatting: Text formatting
348 setting_text_formatting: Text formatting
349 setting_wiki_compression: Wiki history compression
349 setting_wiki_compression: Wiki history compression
350 setting_feeds_limit: Maximum number of items in Atom feeds
350 setting_feeds_limit: Maximum number of items in Atom feeds
351 setting_default_projects_public: New projects are public by default
351 setting_default_projects_public: New projects are public by default
352 setting_autofetch_changesets: Fetch commits automatically
352 setting_autofetch_changesets: Fetch commits automatically
353 setting_sys_api_enabled: Enable WS for repository management
353 setting_sys_api_enabled: Enable WS for repository management
354 setting_commit_ref_keywords: Referencing keywords
354 setting_commit_ref_keywords: Referencing keywords
355 setting_commit_fix_keywords: Fixing keywords
355 setting_commit_fix_keywords: Fixing keywords
356 setting_autologin: Autologin
356 setting_autologin: Autologin
357 setting_date_format: Date format
357 setting_date_format: Date format
358 setting_time_format: Time format
358 setting_time_format: Time format
359 setting_cross_project_issue_relations: Allow cross-project issue relations
359 setting_cross_project_issue_relations: Allow cross-project issue relations
360 setting_cross_project_subtasks: Allow cross-project subtasks
360 setting_issue_list_default_columns: Default columns displayed on the issue list
361 setting_issue_list_default_columns: Default columns displayed on the issue list
361 setting_repositories_encodings: Attachments and repositories encodings
362 setting_repositories_encodings: Attachments and repositories encodings
362 setting_emails_header: Emails header
363 setting_emails_header: Emails header
363 setting_emails_footer: Emails footer
364 setting_emails_footer: Emails footer
364 setting_protocol: Protocol
365 setting_protocol: Protocol
365 setting_per_page_options: Objects per page options
366 setting_per_page_options: Objects per page options
366 setting_user_format: Users display format
367 setting_user_format: Users display format
367 setting_activity_days_default: Days displayed on project activity
368 setting_activity_days_default: Days displayed on project activity
368 setting_display_subprojects_issues: Display subprojects issues on main projects by default
369 setting_display_subprojects_issues: Display subprojects issues on main projects by default
369 setting_enabled_scm: Enabled SCM
370 setting_enabled_scm: Enabled SCM
370 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
371 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
371 setting_mail_handler_api_enabled: Enable WS for incoming emails
372 setting_mail_handler_api_enabled: Enable WS for incoming emails
372 setting_mail_handler_api_key: API key
373 setting_mail_handler_api_key: API key
373 setting_sequential_project_identifiers: Generate sequential project identifiers
374 setting_sequential_project_identifiers: Generate sequential project identifiers
374 setting_gravatar_enabled: Use Gravatar user icons
375 setting_gravatar_enabled: Use Gravatar user icons
375 setting_gravatar_default: Default Gravatar image
376 setting_gravatar_default: Default Gravatar image
376 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
377 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
377 setting_file_max_size_displayed: Maximum size of text files displayed inline
378 setting_file_max_size_displayed: Maximum size of text files displayed inline
378 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
379 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
379 setting_openid: Allow OpenID login and registration
380 setting_openid: Allow OpenID login and registration
380 setting_password_min_length: Minimum password length
381 setting_password_min_length: Minimum password length
381 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
382 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
382 setting_default_projects_modules: Default enabled modules for new projects
383 setting_default_projects_modules: Default enabled modules for new projects
383 setting_issue_done_ratio: Calculate the issue done ratio with
384 setting_issue_done_ratio: Calculate the issue done ratio with
384 setting_issue_done_ratio_issue_field: Use the issue field
385 setting_issue_done_ratio_issue_field: Use the issue field
385 setting_issue_done_ratio_issue_status: Use the issue status
386 setting_issue_done_ratio_issue_status: Use the issue status
386 setting_start_of_week: Start calendars on
387 setting_start_of_week: Start calendars on
387 setting_rest_api_enabled: Enable REST web service
388 setting_rest_api_enabled: Enable REST web service
388 setting_cache_formatted_text: Cache formatted text
389 setting_cache_formatted_text: Cache formatted text
389 setting_default_notification_option: Default notification option
390 setting_default_notification_option: Default notification option
390 setting_commit_logtime_enabled: Enable time logging
391 setting_commit_logtime_enabled: Enable time logging
391 setting_commit_logtime_activity_id: Activity for logged time
392 setting_commit_logtime_activity_id: Activity for logged time
392 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
393 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
393 setting_issue_group_assignment: Allow issue assignment to groups
394 setting_issue_group_assignment: Allow issue assignment to groups
394 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
395 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
395 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
396 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
396 setting_unsubscribe: Allow users to delete their own account
397 setting_unsubscribe: Allow users to delete their own account
397 setting_session_lifetime: Session maximum lifetime
398 setting_session_lifetime: Session maximum lifetime
398 setting_session_timeout: Session inactivity timeout
399 setting_session_timeout: Session inactivity timeout
399 setting_thumbnails_enabled: Display attachment thumbnails
400 setting_thumbnails_enabled: Display attachment thumbnails
400 setting_thumbnails_size: Thumbnails size (in pixels)
401 setting_thumbnails_size: Thumbnails size (in pixels)
401
402
402 permission_add_project: Create project
403 permission_add_project: Create project
403 permission_add_subprojects: Create subprojects
404 permission_add_subprojects: Create subprojects
404 permission_edit_project: Edit project
405 permission_edit_project: Edit project
405 permission_close_project: Close / reopen the project
406 permission_close_project: Close / reopen the project
406 permission_select_project_modules: Select project modules
407 permission_select_project_modules: Select project modules
407 permission_manage_members: Manage members
408 permission_manage_members: Manage members
408 permission_manage_project_activities: Manage project activities
409 permission_manage_project_activities: Manage project activities
409 permission_manage_versions: Manage versions
410 permission_manage_versions: Manage versions
410 permission_manage_categories: Manage issue categories
411 permission_manage_categories: Manage issue categories
411 permission_view_issues: View Issues
412 permission_view_issues: View Issues
412 permission_add_issues: Add issues
413 permission_add_issues: Add issues
413 permission_edit_issues: Edit issues
414 permission_edit_issues: Edit issues
414 permission_manage_issue_relations: Manage issue relations
415 permission_manage_issue_relations: Manage issue relations
415 permission_set_issues_private: Set issues public or private
416 permission_set_issues_private: Set issues public or private
416 permission_set_own_issues_private: Set own issues public or private
417 permission_set_own_issues_private: Set own issues public or private
417 permission_add_issue_notes: Add notes
418 permission_add_issue_notes: Add notes
418 permission_edit_issue_notes: Edit notes
419 permission_edit_issue_notes: Edit notes
419 permission_edit_own_issue_notes: Edit own notes
420 permission_edit_own_issue_notes: Edit own notes
420 permission_view_private_notes: View private notes
421 permission_view_private_notes: View private notes
421 permission_set_notes_private: Set notes as private
422 permission_set_notes_private: Set notes as private
422 permission_move_issues: Move issues
423 permission_move_issues: Move issues
423 permission_delete_issues: Delete issues
424 permission_delete_issues: Delete issues
424 permission_manage_public_queries: Manage public queries
425 permission_manage_public_queries: Manage public queries
425 permission_save_queries: Save queries
426 permission_save_queries: Save queries
426 permission_view_gantt: View gantt chart
427 permission_view_gantt: View gantt chart
427 permission_view_calendar: View calendar
428 permission_view_calendar: View calendar
428 permission_view_issue_watchers: View watchers list
429 permission_view_issue_watchers: View watchers list
429 permission_add_issue_watchers: Add watchers
430 permission_add_issue_watchers: Add watchers
430 permission_delete_issue_watchers: Delete watchers
431 permission_delete_issue_watchers: Delete watchers
431 permission_log_time: Log spent time
432 permission_log_time: Log spent time
432 permission_view_time_entries: View spent time
433 permission_view_time_entries: View spent time
433 permission_edit_time_entries: Edit time logs
434 permission_edit_time_entries: Edit time logs
434 permission_edit_own_time_entries: Edit own time logs
435 permission_edit_own_time_entries: Edit own time logs
435 permission_manage_news: Manage news
436 permission_manage_news: Manage news
436 permission_comment_news: Comment news
437 permission_comment_news: Comment news
437 permission_manage_documents: Manage documents
438 permission_manage_documents: Manage documents
438 permission_view_documents: View documents
439 permission_view_documents: View documents
439 permission_manage_files: Manage files
440 permission_manage_files: Manage files
440 permission_view_files: View files
441 permission_view_files: View files
441 permission_manage_wiki: Manage wiki
442 permission_manage_wiki: Manage wiki
442 permission_rename_wiki_pages: Rename wiki pages
443 permission_rename_wiki_pages: Rename wiki pages
443 permission_delete_wiki_pages: Delete wiki pages
444 permission_delete_wiki_pages: Delete wiki pages
444 permission_view_wiki_pages: View wiki
445 permission_view_wiki_pages: View wiki
445 permission_view_wiki_edits: View wiki history
446 permission_view_wiki_edits: View wiki history
446 permission_edit_wiki_pages: Edit wiki pages
447 permission_edit_wiki_pages: Edit wiki pages
447 permission_delete_wiki_pages_attachments: Delete attachments
448 permission_delete_wiki_pages_attachments: Delete attachments
448 permission_protect_wiki_pages: Protect wiki pages
449 permission_protect_wiki_pages: Protect wiki pages
449 permission_manage_repository: Manage repository
450 permission_manage_repository: Manage repository
450 permission_browse_repository: Browse repository
451 permission_browse_repository: Browse repository
451 permission_view_changesets: View changesets
452 permission_view_changesets: View changesets
452 permission_commit_access: Commit access
453 permission_commit_access: Commit access
453 permission_manage_boards: Manage forums
454 permission_manage_boards: Manage forums
454 permission_view_messages: View messages
455 permission_view_messages: View messages
455 permission_add_messages: Post messages
456 permission_add_messages: Post messages
456 permission_edit_messages: Edit messages
457 permission_edit_messages: Edit messages
457 permission_edit_own_messages: Edit own messages
458 permission_edit_own_messages: Edit own messages
458 permission_delete_messages: Delete messages
459 permission_delete_messages: Delete messages
459 permission_delete_own_messages: Delete own messages
460 permission_delete_own_messages: Delete own messages
460 permission_export_wiki_pages: Export wiki pages
461 permission_export_wiki_pages: Export wiki pages
461 permission_manage_subtasks: Manage subtasks
462 permission_manage_subtasks: Manage subtasks
462 permission_manage_related_issues: Manage related issues
463 permission_manage_related_issues: Manage related issues
463
464
464 project_module_issue_tracking: Issue tracking
465 project_module_issue_tracking: Issue tracking
465 project_module_time_tracking: Time tracking
466 project_module_time_tracking: Time tracking
466 project_module_news: News
467 project_module_news: News
467 project_module_documents: Documents
468 project_module_documents: Documents
468 project_module_files: Files
469 project_module_files: Files
469 project_module_wiki: Wiki
470 project_module_wiki: Wiki
470 project_module_repository: Repository
471 project_module_repository: Repository
471 project_module_boards: Forums
472 project_module_boards: Forums
472 project_module_calendar: Calendar
473 project_module_calendar: Calendar
473 project_module_gantt: Gantt
474 project_module_gantt: Gantt
474
475
475 label_user: User
476 label_user: User
476 label_user_plural: Users
477 label_user_plural: Users
477 label_user_new: New user
478 label_user_new: New user
478 label_user_anonymous: Anonymous
479 label_user_anonymous: Anonymous
479 label_project: Project
480 label_project: Project
480 label_project_new: New project
481 label_project_new: New project
481 label_project_plural: Projects
482 label_project_plural: Projects
482 label_x_projects:
483 label_x_projects:
483 zero: no projects
484 zero: no projects
484 one: 1 project
485 one: 1 project
485 other: "%{count} projects"
486 other: "%{count} projects"
486 label_project_all: All Projects
487 label_project_all: All Projects
487 label_project_latest: Latest projects
488 label_project_latest: Latest projects
488 label_issue: Issue
489 label_issue: Issue
489 label_issue_new: New issue
490 label_issue_new: New issue
490 label_issue_plural: Issues
491 label_issue_plural: Issues
491 label_issue_view_all: View all issues
492 label_issue_view_all: View all issues
492 label_issues_by: "Issues by %{value}"
493 label_issues_by: "Issues by %{value}"
493 label_issue_added: Issue added
494 label_issue_added: Issue added
494 label_issue_updated: Issue updated
495 label_issue_updated: Issue updated
495 label_issue_note_added: Note added
496 label_issue_note_added: Note added
496 label_issue_status_updated: Status updated
497 label_issue_status_updated: Status updated
497 label_issue_priority_updated: Priority updated
498 label_issue_priority_updated: Priority updated
498 label_document: Document
499 label_document: Document
499 label_document_new: New document
500 label_document_new: New document
500 label_document_plural: Documents
501 label_document_plural: Documents
501 label_document_added: Document added
502 label_document_added: Document added
502 label_role: Role
503 label_role: Role
503 label_role_plural: Roles
504 label_role_plural: Roles
504 label_role_new: New role
505 label_role_new: New role
505 label_role_and_permissions: Roles and permissions
506 label_role_and_permissions: Roles and permissions
506 label_role_anonymous: Anonymous
507 label_role_anonymous: Anonymous
507 label_role_non_member: Non member
508 label_role_non_member: Non member
508 label_member: Member
509 label_member: Member
509 label_member_new: New member
510 label_member_new: New member
510 label_member_plural: Members
511 label_member_plural: Members
511 label_tracker: Tracker
512 label_tracker: Tracker
512 label_tracker_plural: Trackers
513 label_tracker_plural: Trackers
513 label_tracker_new: New tracker
514 label_tracker_new: New tracker
514 label_workflow: Workflow
515 label_workflow: Workflow
515 label_issue_status: Issue status
516 label_issue_status: Issue status
516 label_issue_status_plural: Issue statuses
517 label_issue_status_plural: Issue statuses
517 label_issue_status_new: New status
518 label_issue_status_new: New status
518 label_issue_category: Issue category
519 label_issue_category: Issue category
519 label_issue_category_plural: Issue categories
520 label_issue_category_plural: Issue categories
520 label_issue_category_new: New category
521 label_issue_category_new: New category
521 label_custom_field: Custom field
522 label_custom_field: Custom field
522 label_custom_field_plural: Custom fields
523 label_custom_field_plural: Custom fields
523 label_custom_field_new: New custom field
524 label_custom_field_new: New custom field
524 label_enumerations: Enumerations
525 label_enumerations: Enumerations
525 label_enumeration_new: New value
526 label_enumeration_new: New value
526 label_information: Information
527 label_information: Information
527 label_information_plural: Information
528 label_information_plural: Information
528 label_please_login: Please log in
529 label_please_login: Please log in
529 label_register: Register
530 label_register: Register
530 label_login_with_open_id_option: or login with OpenID
531 label_login_with_open_id_option: or login with OpenID
531 label_password_lost: Lost password
532 label_password_lost: Lost password
532 label_home: Home
533 label_home: Home
533 label_my_page: My page
534 label_my_page: My page
534 label_my_account: My account
535 label_my_account: My account
535 label_my_projects: My projects
536 label_my_projects: My projects
536 label_my_page_block: My page block
537 label_my_page_block: My page block
537 label_administration: Administration
538 label_administration: Administration
538 label_login: Sign in
539 label_login: Sign in
539 label_logout: Sign out
540 label_logout: Sign out
540 label_help: Help
541 label_help: Help
541 label_reported_issues: Reported issues
542 label_reported_issues: Reported issues
542 label_assigned_to_me_issues: Issues assigned to me
543 label_assigned_to_me_issues: Issues assigned to me
543 label_last_login: Last connection
544 label_last_login: Last connection
544 label_registered_on: Registered on
545 label_registered_on: Registered on
545 label_activity: Activity
546 label_activity: Activity
546 label_overall_activity: Overall activity
547 label_overall_activity: Overall activity
547 label_user_activity: "%{value}'s activity"
548 label_user_activity: "%{value}'s activity"
548 label_new: New
549 label_new: New
549 label_logged_as: Logged in as
550 label_logged_as: Logged in as
550 label_environment: Environment
551 label_environment: Environment
551 label_authentication: Authentication
552 label_authentication: Authentication
552 label_auth_source: Authentication mode
553 label_auth_source: Authentication mode
553 label_auth_source_new: New authentication mode
554 label_auth_source_new: New authentication mode
554 label_auth_source_plural: Authentication modes
555 label_auth_source_plural: Authentication modes
555 label_subproject_plural: Subprojects
556 label_subproject_plural: Subprojects
556 label_subproject_new: New subproject
557 label_subproject_new: New subproject
557 label_and_its_subprojects: "%{value} and its subprojects"
558 label_and_its_subprojects: "%{value} and its subprojects"
558 label_min_max_length: Min - Max length
559 label_min_max_length: Min - Max length
559 label_list: List
560 label_list: List
560 label_date: Date
561 label_date: Date
561 label_integer: Integer
562 label_integer: Integer
562 label_float: Float
563 label_float: Float
563 label_boolean: Boolean
564 label_boolean: Boolean
564 label_string: Text
565 label_string: Text
565 label_text: Long text
566 label_text: Long text
566 label_attribute: Attribute
567 label_attribute: Attribute
567 label_attribute_plural: Attributes
568 label_attribute_plural: Attributes
568 label_download: "%{count} Download"
569 label_download: "%{count} Download"
569 label_download_plural: "%{count} Downloads"
570 label_download_plural: "%{count} Downloads"
570 label_no_data: No data to display
571 label_no_data: No data to display
571 label_change_status: Change status
572 label_change_status: Change status
572 label_history: History
573 label_history: History
573 label_attachment: File
574 label_attachment: File
574 label_attachment_new: New file
575 label_attachment_new: New file
575 label_attachment_delete: Delete file
576 label_attachment_delete: Delete file
576 label_attachment_plural: Files
577 label_attachment_plural: Files
577 label_file_added: File added
578 label_file_added: File added
578 label_report: Report
579 label_report: Report
579 label_report_plural: Reports
580 label_report_plural: Reports
580 label_news: News
581 label_news: News
581 label_news_new: Add news
582 label_news_new: Add news
582 label_news_plural: News
583 label_news_plural: News
583 label_news_latest: Latest news
584 label_news_latest: Latest news
584 label_news_view_all: View all news
585 label_news_view_all: View all news
585 label_news_added: News added
586 label_news_added: News added
586 label_news_comment_added: Comment added to a news
587 label_news_comment_added: Comment added to a news
587 label_settings: Settings
588 label_settings: Settings
588 label_overview: Overview
589 label_overview: Overview
589 label_version: Version
590 label_version: Version
590 label_version_new: New version
591 label_version_new: New version
591 label_version_plural: Versions
592 label_version_plural: Versions
592 label_close_versions: Close completed versions
593 label_close_versions: Close completed versions
593 label_confirmation: Confirmation
594 label_confirmation: Confirmation
594 label_export_to: 'Also available in:'
595 label_export_to: 'Also available in:'
595 label_read: Read...
596 label_read: Read...
596 label_public_projects: Public projects
597 label_public_projects: Public projects
597 label_open_issues: open
598 label_open_issues: open
598 label_open_issues_plural: open
599 label_open_issues_plural: open
599 label_closed_issues: closed
600 label_closed_issues: closed
600 label_closed_issues_plural: closed
601 label_closed_issues_plural: closed
601 label_x_open_issues_abbr_on_total:
602 label_x_open_issues_abbr_on_total:
602 zero: 0 open / %{total}
603 zero: 0 open / %{total}
603 one: 1 open / %{total}
604 one: 1 open / %{total}
604 other: "%{count} open / %{total}"
605 other: "%{count} open / %{total}"
605 label_x_open_issues_abbr:
606 label_x_open_issues_abbr:
606 zero: 0 open
607 zero: 0 open
607 one: 1 open
608 one: 1 open
608 other: "%{count} open"
609 other: "%{count} open"
609 label_x_closed_issues_abbr:
610 label_x_closed_issues_abbr:
610 zero: 0 closed
611 zero: 0 closed
611 one: 1 closed
612 one: 1 closed
612 other: "%{count} closed"
613 other: "%{count} closed"
613 label_x_issues:
614 label_x_issues:
614 zero: 0 issues
615 zero: 0 issues
615 one: 1 issue
616 one: 1 issue
616 other: "%{count} issues"
617 other: "%{count} issues"
617 label_total: Total
618 label_total: Total
618 label_permissions: Permissions
619 label_permissions: Permissions
619 label_current_status: Current status
620 label_current_status: Current status
620 label_new_statuses_allowed: New statuses allowed
621 label_new_statuses_allowed: New statuses allowed
621 label_all: all
622 label_all: all
622 label_any: any
623 label_any: any
623 label_none: none
624 label_none: none
624 label_nobody: nobody
625 label_nobody: nobody
625 label_next: Next
626 label_next: Next
626 label_previous: Previous
627 label_previous: Previous
627 label_used_by: Used by
628 label_used_by: Used by
628 label_details: Details
629 label_details: Details
629 label_add_note: Add a note
630 label_add_note: Add a note
630 label_per_page: Per page
631 label_per_page: Per page
631 label_calendar: Calendar
632 label_calendar: Calendar
632 label_months_from: months from
633 label_months_from: months from
633 label_gantt: Gantt
634 label_gantt: Gantt
634 label_internal: Internal
635 label_internal: Internal
635 label_last_changes: "last %{count} changes"
636 label_last_changes: "last %{count} changes"
636 label_change_view_all: View all changes
637 label_change_view_all: View all changes
637 label_personalize_page: Personalize this page
638 label_personalize_page: Personalize this page
638 label_comment: Comment
639 label_comment: Comment
639 label_comment_plural: Comments
640 label_comment_plural: Comments
640 label_x_comments:
641 label_x_comments:
641 zero: no comments
642 zero: no comments
642 one: 1 comment
643 one: 1 comment
643 other: "%{count} comments"
644 other: "%{count} comments"
644 label_comment_add: Add a comment
645 label_comment_add: Add a comment
645 label_comment_added: Comment added
646 label_comment_added: Comment added
646 label_comment_delete: Delete comments
647 label_comment_delete: Delete comments
647 label_query: Custom query
648 label_query: Custom query
648 label_query_plural: Custom queries
649 label_query_plural: Custom queries
649 label_query_new: New query
650 label_query_new: New query
650 label_my_queries: My custom queries
651 label_my_queries: My custom queries
651 label_filter_add: Add filter
652 label_filter_add: Add filter
652 label_filter_plural: Filters
653 label_filter_plural: Filters
653 label_equals: is
654 label_equals: is
654 label_not_equals: is not
655 label_not_equals: is not
655 label_in_less_than: in less than
656 label_in_less_than: in less than
656 label_in_more_than: in more than
657 label_in_more_than: in more than
657 label_greater_or_equal: '>='
658 label_greater_or_equal: '>='
658 label_less_or_equal: '<='
659 label_less_or_equal: '<='
659 label_between: between
660 label_between: between
660 label_in: in
661 label_in: in
661 label_today: today
662 label_today: today
662 label_all_time: all time
663 label_all_time: all time
663 label_yesterday: yesterday
664 label_yesterday: yesterday
664 label_this_week: this week
665 label_this_week: this week
665 label_last_week: last week
666 label_last_week: last week
666 label_last_n_weeks: "last %{count} weeks"
667 label_last_n_weeks: "last %{count} weeks"
667 label_last_n_days: "last %{count} days"
668 label_last_n_days: "last %{count} days"
668 label_this_month: this month
669 label_this_month: this month
669 label_last_month: last month
670 label_last_month: last month
670 label_this_year: this year
671 label_this_year: this year
671 label_date_range: Date range
672 label_date_range: Date range
672 label_less_than_ago: less than days ago
673 label_less_than_ago: less than days ago
673 label_more_than_ago: more than days ago
674 label_more_than_ago: more than days ago
674 label_ago: days ago
675 label_ago: days ago
675 label_contains: contains
676 label_contains: contains
676 label_not_contains: doesn't contain
677 label_not_contains: doesn't contain
677 label_any_issues_in_project: any issues in project
678 label_any_issues_in_project: any issues in project
678 label_any_issues_not_in_project: any issues not in project
679 label_any_issues_not_in_project: any issues not in project
679 label_no_issues_in_project: no issues in project
680 label_no_issues_in_project: no issues in project
680 label_day_plural: days
681 label_day_plural: days
681 label_repository: Repository
682 label_repository: Repository
682 label_repository_new: New repository
683 label_repository_new: New repository
683 label_repository_plural: Repositories
684 label_repository_plural: Repositories
684 label_browse: Browse
685 label_browse: Browse
685 label_modification: "%{count} change"
686 label_modification: "%{count} change"
686 label_modification_plural: "%{count} changes"
687 label_modification_plural: "%{count} changes"
687 label_branch: Branch
688 label_branch: Branch
688 label_tag: Tag
689 label_tag: Tag
689 label_revision: Revision
690 label_revision: Revision
690 label_revision_plural: Revisions
691 label_revision_plural: Revisions
691 label_revision_id: "Revision %{value}"
692 label_revision_id: "Revision %{value}"
692 label_associated_revisions: Associated revisions
693 label_associated_revisions: Associated revisions
693 label_added: added
694 label_added: added
694 label_modified: modified
695 label_modified: modified
695 label_copied: copied
696 label_copied: copied
696 label_renamed: renamed
697 label_renamed: renamed
697 label_deleted: deleted
698 label_deleted: deleted
698 label_latest_revision: Latest revision
699 label_latest_revision: Latest revision
699 label_latest_revision_plural: Latest revisions
700 label_latest_revision_plural: Latest revisions
700 label_view_revisions: View revisions
701 label_view_revisions: View revisions
701 label_view_all_revisions: View all revisions
702 label_view_all_revisions: View all revisions
702 label_max_size: Maximum size
703 label_max_size: Maximum size
703 label_sort_highest: Move to top
704 label_sort_highest: Move to top
704 label_sort_higher: Move up
705 label_sort_higher: Move up
705 label_sort_lower: Move down
706 label_sort_lower: Move down
706 label_sort_lowest: Move to bottom
707 label_sort_lowest: Move to bottom
707 label_roadmap: Roadmap
708 label_roadmap: Roadmap
708 label_roadmap_due_in: "Due in %{value}"
709 label_roadmap_due_in: "Due in %{value}"
709 label_roadmap_overdue: "%{value} late"
710 label_roadmap_overdue: "%{value} late"
710 label_roadmap_no_issues: No issues for this version
711 label_roadmap_no_issues: No issues for this version
711 label_search: Search
712 label_search: Search
712 label_result_plural: Results
713 label_result_plural: Results
713 label_all_words: All words
714 label_all_words: All words
714 label_wiki: Wiki
715 label_wiki: Wiki
715 label_wiki_edit: Wiki edit
716 label_wiki_edit: Wiki edit
716 label_wiki_edit_plural: Wiki edits
717 label_wiki_edit_plural: Wiki edits
717 label_wiki_page: Wiki page
718 label_wiki_page: Wiki page
718 label_wiki_page_plural: Wiki pages
719 label_wiki_page_plural: Wiki pages
719 label_index_by_title: Index by title
720 label_index_by_title: Index by title
720 label_index_by_date: Index by date
721 label_index_by_date: Index by date
721 label_current_version: Current version
722 label_current_version: Current version
722 label_preview: Preview
723 label_preview: Preview
723 label_feed_plural: Feeds
724 label_feed_plural: Feeds
724 label_changes_details: Details of all changes
725 label_changes_details: Details of all changes
725 label_issue_tracking: Issue tracking
726 label_issue_tracking: Issue tracking
726 label_spent_time: Spent time
727 label_spent_time: Spent time
727 label_overall_spent_time: Overall spent time
728 label_overall_spent_time: Overall spent time
728 label_f_hour: "%{value} hour"
729 label_f_hour: "%{value} hour"
729 label_f_hour_plural: "%{value} hours"
730 label_f_hour_plural: "%{value} hours"
730 label_time_tracking: Time tracking
731 label_time_tracking: Time tracking
731 label_change_plural: Changes
732 label_change_plural: Changes
732 label_statistics: Statistics
733 label_statistics: Statistics
733 label_commits_per_month: Commits per month
734 label_commits_per_month: Commits per month
734 label_commits_per_author: Commits per author
735 label_commits_per_author: Commits per author
735 label_diff: diff
736 label_diff: diff
736 label_view_diff: View differences
737 label_view_diff: View differences
737 label_diff_inline: inline
738 label_diff_inline: inline
738 label_diff_side_by_side: side by side
739 label_diff_side_by_side: side by side
739 label_options: Options
740 label_options: Options
740 label_copy_workflow_from: Copy workflow from
741 label_copy_workflow_from: Copy workflow from
741 label_permissions_report: Permissions report
742 label_permissions_report: Permissions report
742 label_watched_issues: Watched issues
743 label_watched_issues: Watched issues
743 label_related_issues: Related issues
744 label_related_issues: Related issues
744 label_applied_status: Applied status
745 label_applied_status: Applied status
745 label_loading: Loading...
746 label_loading: Loading...
746 label_relation_new: New relation
747 label_relation_new: New relation
747 label_relation_delete: Delete relation
748 label_relation_delete: Delete relation
748 label_relates_to: Related to
749 label_relates_to: Related to
749 label_duplicates: Duplicates
750 label_duplicates: Duplicates
750 label_duplicated_by: Duplicated by
751 label_duplicated_by: Duplicated by
751 label_blocks: Blocks
752 label_blocks: Blocks
752 label_blocked_by: Blocked by
753 label_blocked_by: Blocked by
753 label_precedes: Precedes
754 label_precedes: Precedes
754 label_follows: Follows
755 label_follows: Follows
755 label_copied_to: Copied to
756 label_copied_to: Copied to
756 label_copied_from: Copied from
757 label_copied_from: Copied from
757 label_end_to_start: end to start
758 label_end_to_start: end to start
758 label_end_to_end: end to end
759 label_end_to_end: end to end
759 label_start_to_start: start to start
760 label_start_to_start: start to start
760 label_start_to_end: start to end
761 label_start_to_end: start to end
761 label_stay_logged_in: Stay logged in
762 label_stay_logged_in: Stay logged in
762 label_disabled: disabled
763 label_disabled: disabled
763 label_show_completed_versions: Show completed versions
764 label_show_completed_versions: Show completed versions
764 label_me: me
765 label_me: me
765 label_board: Forum
766 label_board: Forum
766 label_board_new: New forum
767 label_board_new: New forum
767 label_board_plural: Forums
768 label_board_plural: Forums
768 label_board_locked: Locked
769 label_board_locked: Locked
769 label_board_sticky: Sticky
770 label_board_sticky: Sticky
770 label_topic_plural: Topics
771 label_topic_plural: Topics
771 label_message_plural: Messages
772 label_message_plural: Messages
772 label_message_last: Last message
773 label_message_last: Last message
773 label_message_new: New message
774 label_message_new: New message
774 label_message_posted: Message added
775 label_message_posted: Message added
775 label_reply_plural: Replies
776 label_reply_plural: Replies
776 label_send_information: Send account information to the user
777 label_send_information: Send account information to the user
777 label_year: Year
778 label_year: Year
778 label_month: Month
779 label_month: Month
779 label_week: Week
780 label_week: Week
780 label_date_from: From
781 label_date_from: From
781 label_date_to: To
782 label_date_to: To
782 label_language_based: Based on user's language
783 label_language_based: Based on user's language
783 label_sort_by: "Sort by %{value}"
784 label_sort_by: "Sort by %{value}"
784 label_send_test_email: Send a test email
785 label_send_test_email: Send a test email
785 label_feeds_access_key: RSS access key
786 label_feeds_access_key: RSS access key
786 label_missing_feeds_access_key: Missing a RSS access key
787 label_missing_feeds_access_key: Missing a RSS access key
787 label_feeds_access_key_created_on: "RSS access key created %{value} ago"
788 label_feeds_access_key_created_on: "RSS access key created %{value} ago"
788 label_module_plural: Modules
789 label_module_plural: Modules
789 label_added_time_by: "Added by %{author} %{age} ago"
790 label_added_time_by: "Added by %{author} %{age} ago"
790 label_updated_time_by: "Updated by %{author} %{age} ago"
791 label_updated_time_by: "Updated by %{author} %{age} ago"
791 label_updated_time: "Updated %{value} ago"
792 label_updated_time: "Updated %{value} ago"
792 label_jump_to_a_project: Jump to a project...
793 label_jump_to_a_project: Jump to a project...
793 label_file_plural: Files
794 label_file_plural: Files
794 label_changeset_plural: Changesets
795 label_changeset_plural: Changesets
795 label_default_columns: Default columns
796 label_default_columns: Default columns
796 label_no_change_option: (No change)
797 label_no_change_option: (No change)
797 label_bulk_edit_selected_issues: Bulk edit selected issues
798 label_bulk_edit_selected_issues: Bulk edit selected issues
798 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
799 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
799 label_theme: Theme
800 label_theme: Theme
800 label_default: Default
801 label_default: Default
801 label_search_titles_only: Search titles only
802 label_search_titles_only: Search titles only
802 label_user_mail_option_all: "For any event on all my projects"
803 label_user_mail_option_all: "For any event on all my projects"
803 label_user_mail_option_selected: "For any event on the selected projects only..."
804 label_user_mail_option_selected: "For any event on the selected projects only..."
804 label_user_mail_option_none: "No events"
805 label_user_mail_option_none: "No events"
805 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
806 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
806 label_user_mail_option_only_assigned: "Only for things I am assigned to"
807 label_user_mail_option_only_assigned: "Only for things I am assigned to"
807 label_user_mail_option_only_owner: "Only for things I am the owner of"
808 label_user_mail_option_only_owner: "Only for things I am the owner of"
808 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
809 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
809 label_registration_activation_by_email: account activation by email
810 label_registration_activation_by_email: account activation by email
810 label_registration_manual_activation: manual account activation
811 label_registration_manual_activation: manual account activation
811 label_registration_automatic_activation: automatic account activation
812 label_registration_automatic_activation: automatic account activation
812 label_display_per_page: "Per page: %{value}"
813 label_display_per_page: "Per page: %{value}"
813 label_age: Age
814 label_age: Age
814 label_change_properties: Change properties
815 label_change_properties: Change properties
815 label_general: General
816 label_general: General
816 label_more: More
817 label_more: More
817 label_scm: SCM
818 label_scm: SCM
818 label_plugins: Plugins
819 label_plugins: Plugins
819 label_ldap_authentication: LDAP authentication
820 label_ldap_authentication: LDAP authentication
820 label_downloads_abbr: D/L
821 label_downloads_abbr: D/L
821 label_optional_description: Optional description
822 label_optional_description: Optional description
822 label_add_another_file: Add another file
823 label_add_another_file: Add another file
823 label_preferences: Preferences
824 label_preferences: Preferences
824 label_chronological_order: In chronological order
825 label_chronological_order: In chronological order
825 label_reverse_chronological_order: In reverse chronological order
826 label_reverse_chronological_order: In reverse chronological order
826 label_planning: Planning
827 label_planning: Planning
827 label_incoming_emails: Incoming emails
828 label_incoming_emails: Incoming emails
828 label_generate_key: Generate a key
829 label_generate_key: Generate a key
829 label_issue_watchers: Watchers
830 label_issue_watchers: Watchers
830 label_example: Example
831 label_example: Example
831 label_display: Display
832 label_display: Display
832 label_sort: Sort
833 label_sort: Sort
833 label_ascending: Ascending
834 label_ascending: Ascending
834 label_descending: Descending
835 label_descending: Descending
835 label_date_from_to: From %{start} to %{end}
836 label_date_from_to: From %{start} to %{end}
836 label_wiki_content_added: Wiki page added
837 label_wiki_content_added: Wiki page added
837 label_wiki_content_updated: Wiki page updated
838 label_wiki_content_updated: Wiki page updated
838 label_group: Group
839 label_group: Group
839 label_group_plural: Groups
840 label_group_plural: Groups
840 label_group_new: New group
841 label_group_new: New group
841 label_time_entry_plural: Spent time
842 label_time_entry_plural: Spent time
842 label_version_sharing_none: Not shared
843 label_version_sharing_none: Not shared
843 label_version_sharing_descendants: With subprojects
844 label_version_sharing_descendants: With subprojects
844 label_version_sharing_hierarchy: With project hierarchy
845 label_version_sharing_hierarchy: With project hierarchy
845 label_version_sharing_tree: With project tree
846 label_version_sharing_tree: With project tree
846 label_version_sharing_system: With all projects
847 label_version_sharing_system: With all projects
847 label_update_issue_done_ratios: Update issue done ratios
848 label_update_issue_done_ratios: Update issue done ratios
848 label_copy_source: Source
849 label_copy_source: Source
849 label_copy_target: Target
850 label_copy_target: Target
850 label_copy_same_as_target: Same as target
851 label_copy_same_as_target: Same as target
851 label_display_used_statuses_only: Only display statuses that are used by this tracker
852 label_display_used_statuses_only: Only display statuses that are used by this tracker
852 label_api_access_key: API access key
853 label_api_access_key: API access key
853 label_missing_api_access_key: Missing an API access key
854 label_missing_api_access_key: Missing an API access key
854 label_api_access_key_created_on: "API access key created %{value} ago"
855 label_api_access_key_created_on: "API access key created %{value} ago"
855 label_profile: Profile
856 label_profile: Profile
856 label_subtask_plural: Subtasks
857 label_subtask_plural: Subtasks
857 label_project_copy_notifications: Send email notifications during the project copy
858 label_project_copy_notifications: Send email notifications during the project copy
858 label_principal_search: "Search for user or group:"
859 label_principal_search: "Search for user or group:"
859 label_user_search: "Search for user:"
860 label_user_search: "Search for user:"
860 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
861 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
861 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
862 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
862 label_issues_visibility_all: All issues
863 label_issues_visibility_all: All issues
863 label_issues_visibility_public: All non private issues
864 label_issues_visibility_public: All non private issues
864 label_issues_visibility_own: Issues created by or assigned to the user
865 label_issues_visibility_own: Issues created by or assigned to the user
865 label_git_report_last_commit: Report last commit for files and directories
866 label_git_report_last_commit: Report last commit for files and directories
866 label_parent_revision: Parent
867 label_parent_revision: Parent
867 label_child_revision: Child
868 label_child_revision: Child
868 label_export_options: "%{export_format} export options"
869 label_export_options: "%{export_format} export options"
869 label_copy_attachments: Copy attachments
870 label_copy_attachments: Copy attachments
870 label_copy_subtasks: Copy subtasks
871 label_copy_subtasks: Copy subtasks
871 label_item_position: "%{position} of %{count}"
872 label_item_position: "%{position} of %{count}"
872 label_completed_versions: Completed versions
873 label_completed_versions: Completed versions
873 label_search_for_watchers: Search for watchers to add
874 label_search_for_watchers: Search for watchers to add
874 label_session_expiration: Session expiration
875 label_session_expiration: Session expiration
875 label_show_closed_projects: View closed projects
876 label_show_closed_projects: View closed projects
876 label_status_transitions: Status transitions
877 label_status_transitions: Status transitions
877 label_fields_permissions: Fields permissions
878 label_fields_permissions: Fields permissions
878 label_readonly: Read-only
879 label_readonly: Read-only
879 label_required: Required
880 label_required: Required
880 label_attribute_of_project: "Project's %{name}"
881 label_attribute_of_project: "Project's %{name}"
881 label_attribute_of_author: "Author's %{name}"
882 label_attribute_of_author: "Author's %{name}"
882 label_attribute_of_assigned_to: "Assignee's %{name}"
883 label_attribute_of_assigned_to: "Assignee's %{name}"
883 label_attribute_of_fixed_version: "Target version's %{name}"
884 label_attribute_of_fixed_version: "Target version's %{name}"
884
885
885 button_login: Login
886 button_login: Login
886 button_submit: Submit
887 button_submit: Submit
887 button_save: Save
888 button_save: Save
888 button_check_all: Check all
889 button_check_all: Check all
889 button_uncheck_all: Uncheck all
890 button_uncheck_all: Uncheck all
890 button_collapse_all: Collapse all
891 button_collapse_all: Collapse all
891 button_expand_all: Expand all
892 button_expand_all: Expand all
892 button_delete: Delete
893 button_delete: Delete
893 button_create: Create
894 button_create: Create
894 button_create_and_continue: Create and continue
895 button_create_and_continue: Create and continue
895 button_test: Test
896 button_test: Test
896 button_edit: Edit
897 button_edit: Edit
897 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
898 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
898 button_add: Add
899 button_add: Add
899 button_change: Change
900 button_change: Change
900 button_apply: Apply
901 button_apply: Apply
901 button_clear: Clear
902 button_clear: Clear
902 button_lock: Lock
903 button_lock: Lock
903 button_unlock: Unlock
904 button_unlock: Unlock
904 button_download: Download
905 button_download: Download
905 button_list: List
906 button_list: List
906 button_view: View
907 button_view: View
907 button_move: Move
908 button_move: Move
908 button_move_and_follow: Move and follow
909 button_move_and_follow: Move and follow
909 button_back: Back
910 button_back: Back
910 button_cancel: Cancel
911 button_cancel: Cancel
911 button_activate: Activate
912 button_activate: Activate
912 button_sort: Sort
913 button_sort: Sort
913 button_log_time: Log time
914 button_log_time: Log time
914 button_rollback: Rollback to this version
915 button_rollback: Rollback to this version
915 button_watch: Watch
916 button_watch: Watch
916 button_unwatch: Unwatch
917 button_unwatch: Unwatch
917 button_reply: Reply
918 button_reply: Reply
918 button_archive: Archive
919 button_archive: Archive
919 button_unarchive: Unarchive
920 button_unarchive: Unarchive
920 button_reset: Reset
921 button_reset: Reset
921 button_rename: Rename
922 button_rename: Rename
922 button_change_password: Change password
923 button_change_password: Change password
923 button_copy: Copy
924 button_copy: Copy
924 button_copy_and_follow: Copy and follow
925 button_copy_and_follow: Copy and follow
925 button_annotate: Annotate
926 button_annotate: Annotate
926 button_update: Update
927 button_update: Update
927 button_configure: Configure
928 button_configure: Configure
928 button_quote: Quote
929 button_quote: Quote
929 button_duplicate: Duplicate
930 button_duplicate: Duplicate
930 button_show: Show
931 button_show: Show
931 button_edit_section: Edit this section
932 button_edit_section: Edit this section
932 button_export: Export
933 button_export: Export
933 button_delete_my_account: Delete my account
934 button_delete_my_account: Delete my account
934 button_close: Close
935 button_close: Close
935 button_reopen: Reopen
936 button_reopen: Reopen
936
937
937 status_active: active
938 status_active: active
938 status_registered: registered
939 status_registered: registered
939 status_locked: locked
940 status_locked: locked
940
941
941 project_status_active: active
942 project_status_active: active
942 project_status_closed: closed
943 project_status_closed: closed
943 project_status_archived: archived
944 project_status_archived: archived
944
945
945 version_status_open: open
946 version_status_open: open
946 version_status_locked: locked
947 version_status_locked: locked
947 version_status_closed: closed
948 version_status_closed: closed
948
949
949 field_active: Active
950 field_active: Active
950
951
951 text_select_mail_notifications: Select actions for which email notifications should be sent.
952 text_select_mail_notifications: Select actions for which email notifications should be sent.
952 text_regexp_info: eg. ^[A-Z0-9]+$
953 text_regexp_info: eg. ^[A-Z0-9]+$
953 text_min_max_length_info: 0 means no restriction
954 text_min_max_length_info: 0 means no restriction
954 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
955 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
955 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
956 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
956 text_workflow_edit: Select a role and a tracker to edit the workflow
957 text_workflow_edit: Select a role and a tracker to edit the workflow
957 text_are_you_sure: Are you sure?
958 text_are_you_sure: Are you sure?
958 text_are_you_sure_with_children: "Delete issue and all child issues?"
959 text_are_you_sure_with_children: "Delete issue and all child issues?"
959 text_journal_changed: "%{label} changed from %{old} to %{new}"
960 text_journal_changed: "%{label} changed from %{old} to %{new}"
960 text_journal_changed_no_detail: "%{label} updated"
961 text_journal_changed_no_detail: "%{label} updated"
961 text_journal_set_to: "%{label} set to %{value}"
962 text_journal_set_to: "%{label} set to %{value}"
962 text_journal_deleted: "%{label} deleted (%{old})"
963 text_journal_deleted: "%{label} deleted (%{old})"
963 text_journal_added: "%{label} %{value} added"
964 text_journal_added: "%{label} %{value} added"
964 text_tip_issue_begin_day: issue beginning this day
965 text_tip_issue_begin_day: issue beginning this day
965 text_tip_issue_end_day: issue ending this day
966 text_tip_issue_end_day: issue ending this day
966 text_tip_issue_begin_end_day: issue beginning and ending this day
967 text_tip_issue_begin_end_day: issue beginning and ending this day
967 text_project_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
968 text_project_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
968 text_caracters_maximum: "%{count} characters maximum."
969 text_caracters_maximum: "%{count} characters maximum."
969 text_caracters_minimum: "Must be at least %{count} characters long."
970 text_caracters_minimum: "Must be at least %{count} characters long."
970 text_length_between: "Length between %{min} and %{max} characters."
971 text_length_between: "Length between %{min} and %{max} characters."
971 text_tracker_no_workflow: No workflow defined for this tracker
972 text_tracker_no_workflow: No workflow defined for this tracker
972 text_unallowed_characters: Unallowed characters
973 text_unallowed_characters: Unallowed characters
973 text_comma_separated: Multiple values allowed (comma separated).
974 text_comma_separated: Multiple values allowed (comma separated).
974 text_line_separated: Multiple values allowed (one line for each value).
975 text_line_separated: Multiple values allowed (one line for each value).
975 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
976 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
976 text_issue_added: "Issue %{id} has been reported by %{author}."
977 text_issue_added: "Issue %{id} has been reported by %{author}."
977 text_issue_updated: "Issue %{id} has been updated by %{author}."
978 text_issue_updated: "Issue %{id} has been updated by %{author}."
978 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
979 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
979 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
980 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
980 text_issue_category_destroy_assignments: Remove category assignments
981 text_issue_category_destroy_assignments: Remove category assignments
981 text_issue_category_reassign_to: Reassign issues to this category
982 text_issue_category_reassign_to: Reassign issues to this category
982 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)."
983 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)."
983 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."
984 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."
984 text_load_default_configuration: Load the default configuration
985 text_load_default_configuration: Load the default configuration
985 text_status_changed_by_changeset: "Applied in changeset %{value}."
986 text_status_changed_by_changeset: "Applied in changeset %{value}."
986 text_time_logged_by_changeset: "Applied in changeset %{value}."
987 text_time_logged_by_changeset: "Applied in changeset %{value}."
987 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
988 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
988 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
989 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
989 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
990 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
990 text_select_project_modules: 'Select modules to enable for this project:'
991 text_select_project_modules: 'Select modules to enable for this project:'
991 text_default_administrator_account_changed: Default administrator account changed
992 text_default_administrator_account_changed: Default administrator account changed
992 text_file_repository_writable: Attachments directory writable
993 text_file_repository_writable: Attachments directory writable
993 text_plugin_assets_writable: Plugin assets directory writable
994 text_plugin_assets_writable: Plugin assets directory writable
994 text_rmagick_available: RMagick available (optional)
995 text_rmagick_available: RMagick available (optional)
995 text_destroy_time_entries_question: "%{hours} hours were reported on the issues you are about to delete. What do you want to do?"
996 text_destroy_time_entries_question: "%{hours} hours were reported on the issues you are about to delete. What do you want to do?"
996 text_destroy_time_entries: Delete reported hours
997 text_destroy_time_entries: Delete reported hours
997 text_assign_time_entries_to_project: Assign reported hours to the project
998 text_assign_time_entries_to_project: Assign reported hours to the project
998 text_reassign_time_entries: 'Reassign reported hours to this issue:'
999 text_reassign_time_entries: 'Reassign reported hours to this issue:'
999 text_user_wrote: "%{value} wrote:"
1000 text_user_wrote: "%{value} wrote:"
1000 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
1001 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
1001 text_enumeration_category_reassign_to: 'Reassign them to this value:'
1002 text_enumeration_category_reassign_to: 'Reassign them to this value:'
1002 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."
1003 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."
1003 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."
1004 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."
1004 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
1005 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
1005 text_custom_field_possible_values_info: 'One line for each value'
1006 text_custom_field_possible_values_info: 'One line for each value'
1006 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
1007 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
1007 text_wiki_page_nullify_children: "Keep child pages as root pages"
1008 text_wiki_page_nullify_children: "Keep child pages as root pages"
1008 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
1009 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
1009 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1010 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1010 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?"
1011 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?"
1011 text_zoom_in: Zoom in
1012 text_zoom_in: Zoom in
1012 text_zoom_out: Zoom out
1013 text_zoom_out: Zoom out
1013 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1014 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1014 text_scm_path_encoding_note: "Default: UTF-8"
1015 text_scm_path_encoding_note: "Default: UTF-8"
1015 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1016 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1016 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1017 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1017 text_scm_command: Command
1018 text_scm_command: Command
1018 text_scm_command_version: Version
1019 text_scm_command_version: Version
1019 text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
1020 text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
1020 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
1021 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
1021 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1022 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1022 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1023 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1023 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1024 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1024 text_account_destroy_confirmation: "Are you sure you want to proceed?\nYour account will be permanently deleted, with no way to reactivate it."
1025 text_account_destroy_confirmation: "Are you sure you want to proceed?\nYour account will be permanently deleted, with no way to reactivate it."
1025 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1026 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1026 text_project_closed: This project is closed and read-only.
1027 text_project_closed: This project is closed and read-only.
1027
1028
1028 default_role_manager: Manager
1029 default_role_manager: Manager
1029 default_role_developer: Developer
1030 default_role_developer: Developer
1030 default_role_reporter: Reporter
1031 default_role_reporter: Reporter
1031 default_tracker_bug: Bug
1032 default_tracker_bug: Bug
1032 default_tracker_feature: Feature
1033 default_tracker_feature: Feature
1033 default_tracker_support: Support
1034 default_tracker_support: Support
1034 default_issue_status_new: New
1035 default_issue_status_new: New
1035 default_issue_status_in_progress: In Progress
1036 default_issue_status_in_progress: In Progress
1036 default_issue_status_resolved: Resolved
1037 default_issue_status_resolved: Resolved
1037 default_issue_status_feedback: Feedback
1038 default_issue_status_feedback: Feedback
1038 default_issue_status_closed: Closed
1039 default_issue_status_closed: Closed
1039 default_issue_status_rejected: Rejected
1040 default_issue_status_rejected: Rejected
1040 default_doc_category_user: User documentation
1041 default_doc_category_user: User documentation
1041 default_doc_category_tech: Technical documentation
1042 default_doc_category_tech: Technical documentation
1042 default_priority_low: Low
1043 default_priority_low: Low
1043 default_priority_normal: Normal
1044 default_priority_normal: Normal
1044 default_priority_high: High
1045 default_priority_high: High
1045 default_priority_urgent: Urgent
1046 default_priority_urgent: Urgent
1046 default_priority_immediate: Immediate
1047 default_priority_immediate: Immediate
1047 default_activity_design: Design
1048 default_activity_design: Design
1048 default_activity_development: Development
1049 default_activity_development: Development
1049
1050
1050 enumeration_issue_priorities: Issue priorities
1051 enumeration_issue_priorities: Issue priorities
1051 enumeration_doc_categories: Document categories
1052 enumeration_doc_categories: Document categories
1052 enumeration_activities: Activities (time tracking)
1053 enumeration_activities: Activities (time tracking)
1053 enumeration_system_activity: System Activity
1054 enumeration_system_activity: System Activity
1054 description_filter: Filter
1055 description_filter: Filter
1055 description_search: Searchfield
1056 description_search: Searchfield
1056 description_choose_project: Projects
1057 description_choose_project: Projects
1057 description_project_scope: Search scope
1058 description_project_scope: Search scope
1058 description_notes: Notes
1059 description_notes: Notes
1059 description_message_content: Message content
1060 description_message_content: Message content
1060 description_query_sort_criteria_attribute: Sort attribute
1061 description_query_sort_criteria_attribute: Sort attribute
1061 description_query_sort_criteria_direction: Sort direction
1062 description_query_sort_criteria_direction: Sort direction
1062 description_user_mail_notification: Mail notification settings
1063 description_user_mail_notification: Mail notification settings
1063 description_available_columns: Available Columns
1064 description_available_columns: Available Columns
1064 description_selected_columns: Selected Columns
1065 description_selected_columns: Selected Columns
1065 description_all_columns: All Columns
1066 description_all_columns: All Columns
1066 description_issue_category_reassign: Choose issue category
1067 description_issue_category_reassign: Choose issue category
1067 description_wiki_subpages_reassign: Choose new parent page
1068 description_wiki_subpages_reassign: Choose new parent page
1068 description_date_range_list: Choose range from list
1069 description_date_range_list: Choose range from list
1069 description_date_range_interval: Choose range by selecting start and end date
1070 description_date_range_interval: Choose range by selecting start and end date
1070 description_date_from: Enter start date
1071 description_date_from: Enter start date
1071 description_date_to: Enter end date
1072 description_date_to: Enter end date
1072 text_repository_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
1073 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,1089 +1,1090
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 month_names: [~, janvier, fΓ©vrier, mars, avril, mai, juin, juillet, aoΓ»t, septembre, octobre, novembre, dΓ©cembre]
18 month_names: [~, janvier, fΓ©vrier, mars, avril, mai, juin, juillet, aoΓ»t, septembre, octobre, novembre, dΓ©cembre]
19 abbr_month_names: [~, jan., fΓ©v., mar., avr., mai, juin, juil., aoΓ»t, sept., oct., nov., dΓ©c.]
19 abbr_month_names: [~, jan., fΓ©v., mar., avr., mai, juin, juil., aoΓ»t, sept., oct., nov., dΓ©c.]
20 order:
20 order:
21 - :day
21 - :day
22 - :month
22 - :month
23 - :year
23 - :year
24
24
25 time:
25 time:
26 formats:
26 formats:
27 default: "%d/%m/%Y %H:%M"
27 default: "%d/%m/%Y %H:%M"
28 time: "%H:%M"
28 time: "%H:%M"
29 short: "%d %b %H:%M"
29 short: "%d %b %H:%M"
30 long: "%A %d %B %Y %H:%M:%S %Z"
30 long: "%A %d %B %Y %H:%M:%S %Z"
31 long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
31 long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
32 only_second: "%S"
32 only_second: "%S"
33 am: 'am'
33 am: 'am'
34 pm: 'pm'
34 pm: 'pm'
35
35
36 datetime:
36 datetime:
37 distance_in_words:
37 distance_in_words:
38 half_a_minute: "30 secondes"
38 half_a_minute: "30 secondes"
39 less_than_x_seconds:
39 less_than_x_seconds:
40 zero: "moins d'une seconde"
40 zero: "moins d'une seconde"
41 one: "moins d'uneΒ seconde"
41 one: "moins d'uneΒ seconde"
42 other: "moins de %{count}Β secondes"
42 other: "moins de %{count}Β secondes"
43 x_seconds:
43 x_seconds:
44 one: "1Β seconde"
44 one: "1Β seconde"
45 other: "%{count}Β secondes"
45 other: "%{count}Β secondes"
46 less_than_x_minutes:
46 less_than_x_minutes:
47 zero: "moins d'une minute"
47 zero: "moins d'une minute"
48 one: "moins d'uneΒ minute"
48 one: "moins d'uneΒ minute"
49 other: "moins de %{count}Β minutes"
49 other: "moins de %{count}Β minutes"
50 x_minutes:
50 x_minutes:
51 one: "1Β minute"
51 one: "1Β minute"
52 other: "%{count}Β minutes"
52 other: "%{count}Β minutes"
53 about_x_hours:
53 about_x_hours:
54 one: "environ une heure"
54 one: "environ une heure"
55 other: "environ %{count}Β heures"
55 other: "environ %{count}Β heures"
56 x_hours:
56 x_hours:
57 one: "une heure"
57 one: "une heure"
58 other: "%{count}Β heures"
58 other: "%{count}Β heures"
59 x_days:
59 x_days:
60 one: "unΒ jour"
60 one: "unΒ jour"
61 other: "%{count}Β jours"
61 other: "%{count}Β jours"
62 about_x_months:
62 about_x_months:
63 one: "environ un mois"
63 one: "environ un mois"
64 other: "environ %{count}Β mois"
64 other: "environ %{count}Β mois"
65 x_months:
65 x_months:
66 one: "unΒ mois"
66 one: "unΒ mois"
67 other: "%{count}Β mois"
67 other: "%{count}Β mois"
68 about_x_years:
68 about_x_years:
69 one: "environ un an"
69 one: "environ un an"
70 other: "environ %{count}Β ans"
70 other: "environ %{count}Β ans"
71 over_x_years:
71 over_x_years:
72 one: "plus d'un an"
72 one: "plus d'un an"
73 other: "plus de %{count}Β ans"
73 other: "plus de %{count}Β ans"
74 almost_x_years:
74 almost_x_years:
75 one: "presqu'un an"
75 one: "presqu'un an"
76 other: "presque %{count} ans"
76 other: "presque %{count} ans"
77 prompts:
77 prompts:
78 year: "AnnΓ©e"
78 year: "AnnΓ©e"
79 month: "Mois"
79 month: "Mois"
80 day: "Jour"
80 day: "Jour"
81 hour: "Heure"
81 hour: "Heure"
82 minute: "Minute"
82 minute: "Minute"
83 second: "Seconde"
83 second: "Seconde"
84
84
85 number:
85 number:
86 format:
86 format:
87 precision: 3
87 precision: 3
88 separator: ','
88 separator: ','
89 delimiter: 'Β '
89 delimiter: 'Β '
90 currency:
90 currency:
91 format:
91 format:
92 unit: '€'
92 unit: '€'
93 precision: 2
93 precision: 2
94 format: '%nΒ %u'
94 format: '%nΒ %u'
95 human:
95 human:
96 format:
96 format:
97 precision: 3
97 precision: 3
98 storage_units:
98 storage_units:
99 format: "%n %u"
99 format: "%n %u"
100 units:
100 units:
101 byte:
101 byte:
102 one: "octet"
102 one: "octet"
103 other: "octet"
103 other: "octet"
104 kb: "ko"
104 kb: "ko"
105 mb: "Mo"
105 mb: "Mo"
106 gb: "Go"
106 gb: "Go"
107 tb: "To"
107 tb: "To"
108
108
109 support:
109 support:
110 array:
110 array:
111 sentence_connector: 'et'
111 sentence_connector: 'et'
112 skip_last_comma: true
112 skip_last_comma: true
113 word_connector: ", "
113 word_connector: ", "
114 two_words_connector: " et "
114 two_words_connector: " et "
115 last_word_connector: " et "
115 last_word_connector: " et "
116
116
117 activerecord:
117 activerecord:
118 errors:
118 errors:
119 template:
119 template:
120 header:
120 header:
121 one: "Impossible d'enregistrer %{model} : une erreur"
121 one: "Impossible d'enregistrer %{model} : une erreur"
122 other: "Impossible d'enregistrer %{model} : %{count} erreurs."
122 other: "Impossible d'enregistrer %{model} : %{count} erreurs."
123 body: "Veuillez vΓ©rifier les champs suivantsΒ :"
123 body: "Veuillez vΓ©rifier les champs suivantsΒ :"
124 messages:
124 messages:
125 inclusion: "n'est pas inclus(e) dans la liste"
125 inclusion: "n'est pas inclus(e) dans la liste"
126 exclusion: "n'est pas disponible"
126 exclusion: "n'est pas disponible"
127 invalid: "n'est pas valide"
127 invalid: "n'est pas valide"
128 confirmation: "ne concorde pas avec la confirmation"
128 confirmation: "ne concorde pas avec la confirmation"
129 accepted: "doit Γͺtre acceptΓ©(e)"
129 accepted: "doit Γͺtre acceptΓ©(e)"
130 empty: "doit Γͺtre renseignΓ©(e)"
130 empty: "doit Γͺtre renseignΓ©(e)"
131 blank: "doit Γͺtre renseignΓ©(e)"
131 blank: "doit Γͺtre renseignΓ©(e)"
132 too_long: "est trop long (pas plus de %{count} caractères)"
132 too_long: "est trop long (pas plus de %{count} caractères)"
133 too_short: "est trop court (au moins %{count} caractères)"
133 too_short: "est trop court (au moins %{count} caractères)"
134 wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
134 wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
135 taken: "est dΓ©jΓ  utilisΓ©"
135 taken: "est dΓ©jΓ  utilisΓ©"
136 not_a_number: "n'est pas un nombre"
136 not_a_number: "n'est pas un nombre"
137 not_a_date: "n'est pas une date valide"
137 not_a_date: "n'est pas une date valide"
138 greater_than: "doit Γͺtre supΓ©rieur Γ  %{count}"
138 greater_than: "doit Γͺtre supΓ©rieur Γ  %{count}"
139 greater_than_or_equal_to: "doit Γͺtre supΓ©rieur ou Γ©gal Γ  %{count}"
139 greater_than_or_equal_to: "doit Γͺtre supΓ©rieur ou Γ©gal Γ  %{count}"
140 equal_to: "doit Γͺtre Γ©gal Γ  %{count}"
140 equal_to: "doit Γͺtre Γ©gal Γ  %{count}"
141 less_than: "doit Γͺtre infΓ©rieur Γ  %{count}"
141 less_than: "doit Γͺtre infΓ©rieur Γ  %{count}"
142 less_than_or_equal_to: "doit Γͺtre infΓ©rieur ou Γ©gal Γ  %{count}"
142 less_than_or_equal_to: "doit Γͺtre infΓ©rieur ou Γ©gal Γ  %{count}"
143 odd: "doit Γͺtre impair"
143 odd: "doit Γͺtre impair"
144 even: "doit Γͺtre pair"
144 even: "doit Γͺtre pair"
145 greater_than_start_date: "doit Γͺtre postΓ©rieure Γ  la date de dΓ©but"
145 greater_than_start_date: "doit Γͺtre postΓ©rieure Γ  la date de dΓ©but"
146 not_same_project: "n'appartient pas au mΓͺme projet"
146 not_same_project: "n'appartient pas au mΓͺme projet"
147 circular_dependency: "Cette relation crΓ©erait une dΓ©pendance circulaire"
147 circular_dependency: "Cette relation crΓ©erait une dΓ©pendance circulaire"
148 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas Γͺtre liΓ©e Γ  l'une de ses sous-tΓ’ches"
148 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas Γͺtre liΓ©e Γ  l'une de ses sous-tΓ’ches"
149
149
150 actionview_instancetag_blank_option: Choisir
150 actionview_instancetag_blank_option: Choisir
151
151
152 general_text_No: 'Non'
152 general_text_No: 'Non'
153 general_text_Yes: 'Oui'
153 general_text_Yes: 'Oui'
154 general_text_no: 'non'
154 general_text_no: 'non'
155 general_text_yes: 'oui'
155 general_text_yes: 'oui'
156 general_lang_name: 'FranΓ§ais'
156 general_lang_name: 'FranΓ§ais'
157 general_csv_separator: ';'
157 general_csv_separator: ';'
158 general_csv_decimal_separator: ','
158 general_csv_decimal_separator: ','
159 general_csv_encoding: ISO-8859-1
159 general_csv_encoding: ISO-8859-1
160 general_pdf_encoding: UTF-8
160 general_pdf_encoding: UTF-8
161 general_first_day_of_week: '1'
161 general_first_day_of_week: '1'
162
162
163 notice_account_updated: Le compte a été mis à jour avec succès.
163 notice_account_updated: Le compte a été mis à jour avec succès.
164 notice_account_invalid_creditentials: Identifiant ou mot de passe invalide.
164 notice_account_invalid_creditentials: Identifiant ou mot de passe invalide.
165 notice_account_password_updated: Mot de passe mis à jour avec succès.
165 notice_account_password_updated: Mot de passe mis à jour avec succès.
166 notice_account_wrong_password: Mot de passe incorrect
166 notice_account_wrong_password: Mot de passe incorrect
167 notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a Γ©tΓ© envoyΓ©.
167 notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a Γ©tΓ© envoyΓ©.
168 notice_account_unknown_email: Aucun compte ne correspond Γ  cette adresse.
168 notice_account_unknown_email: Aucun compte ne correspond Γ  cette adresse.
169 notice_can_t_change_password: Ce compte utilise une authentification externe. Impossible de changer le mot de passe.
169 notice_can_t_change_password: Ce compte utilise une authentification externe. Impossible de changer le mot de passe.
170 notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a Γ©tΓ© envoyΓ©.
170 notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a Γ©tΓ© envoyΓ©.
171 notice_account_activated: Votre compte a Γ©tΓ© activΓ©. Vous pouvez Γ  prΓ©sent vous connecter.
171 notice_account_activated: Votre compte a Γ©tΓ© activΓ©. Vous pouvez Γ  prΓ©sent vous connecter.
172 notice_successful_create: Création effectuée avec succès.
172 notice_successful_create: Création effectuée avec succès.
173 notice_successful_update: Mise à jour effectuée avec succès.
173 notice_successful_update: Mise à jour effectuée avec succès.
174 notice_successful_delete: Suppression effectuée avec succès.
174 notice_successful_delete: Suppression effectuée avec succès.
175 notice_successful_connection: Connexion rΓ©ussie.
175 notice_successful_connection: Connexion rΓ©ussie.
176 notice_file_not_found: "La page Γ  laquelle vous souhaitez accΓ©der n'existe pas ou a Γ©tΓ© supprimΓ©e."
176 notice_file_not_found: "La page Γ  laquelle vous souhaitez accΓ©der n'existe pas ou a Γ©tΓ© supprimΓ©e."
177 notice_locking_conflict: Les donnΓ©es ont Γ©tΓ© mises Γ  jour par un autre utilisateur. Mise Γ  jour impossible.
177 notice_locking_conflict: Les donnΓ©es ont Γ©tΓ© mises Γ  jour par un autre utilisateur. Mise Γ  jour impossible.
178 notice_not_authorized: "Vous n'Γͺtes pas autorisΓ© Γ  accΓ©der Γ  cette page."
178 notice_not_authorized: "Vous n'Γͺtes pas autorisΓ© Γ  accΓ©der Γ  cette page."
179 notice_not_authorized_archived_project: Le projet auquel vous tentez d'accΓ©der a Γ©tΓ© archivΓ©.
179 notice_not_authorized_archived_project: Le projet auquel vous tentez d'accΓ©der a Γ©tΓ© archivΓ©.
180 notice_email_sent: "Un email a Γ©tΓ© envoyΓ© Γ  %{value}"
180 notice_email_sent: "Un email a Γ©tΓ© envoyΓ© Γ  %{value}"
181 notice_email_error: "Erreur lors de l'envoi de l'email (%{value})"
181 notice_email_error: "Erreur lors de l'envoi de l'email (%{value})"
182 notice_feeds_access_key_reseted: "Votre clé d'accès aux flux RSS a été réinitialisée."
182 notice_feeds_access_key_reseted: "Votre clé d'accès aux flux RSS a été réinitialisée."
183 notice_failed_to_save_issues: "%{count} demande(s) sur les %{total} sΓ©lectionnΓ©es n'ont pas pu Γͺtre mise(s) Γ  jour : %{ids}."
183 notice_failed_to_save_issues: "%{count} demande(s) sur les %{total} sΓ©lectionnΓ©es n'ont pas pu Γͺtre mise(s) Γ  jour : %{ids}."
184 notice_failed_to_save_time_entries: "%{count} temps passΓ©(s) sur les %{total} sΓ©lectionnΓ©s n'ont pas pu Γͺtre mis Γ  jour: %{ids}."
184 notice_failed_to_save_time_entries: "%{count} temps passΓ©(s) sur les %{total} sΓ©lectionnΓ©s n'ont pas pu Γͺtre mis Γ  jour: %{ids}."
185 notice_no_issue_selected: "Aucune demande sΓ©lectionnΓ©e ! Cochez les demandes que vous voulez mettre Γ  jour."
185 notice_no_issue_selected: "Aucune demande sΓ©lectionnΓ©e ! Cochez les demandes que vous voulez mettre Γ  jour."
186 notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur."
186 notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur."
187 notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
187 notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
188 notice_unable_delete_version: Impossible de supprimer cette version.
188 notice_unable_delete_version: Impossible de supprimer cette version.
189 notice_issue_done_ratios_updated: L'avancement des demandes a Γ©tΓ© mis Γ  jour.
189 notice_issue_done_ratios_updated: L'avancement des demandes a Γ©tΓ© mis Γ  jour.
190 notice_api_access_key_reseted: Votre clé d'accès API a été réinitialisée.
190 notice_api_access_key_reseted: Votre clé d'accès API a été réinitialisée.
191 notice_gantt_chart_truncated: "Le diagramme a Γ©tΓ© tronquΓ© car il excΓ¨de le nombre maximal d'Γ©lΓ©ments pouvant Γͺtre affichΓ©s (%{max})"
191 notice_gantt_chart_truncated: "Le diagramme a Γ©tΓ© tronquΓ© car il excΓ¨de le nombre maximal d'Γ©lΓ©ments pouvant Γͺtre affichΓ©s (%{max})"
192 notice_issue_successful_create: "Demande %{id} créée."
192 notice_issue_successful_create: "Demande %{id} créée."
193 notice_issue_update_conflict: "La demande a Γ©tΓ© mise Γ  jour par un autre utilisateur pendant que vous la modifiez."
193 notice_issue_update_conflict: "La demande a Γ©tΓ© mise Γ  jour par un autre utilisateur pendant que vous la modifiez."
194 notice_account_deleted: "Votre compte a Γ©tΓ© dΓ©finitivement supprimΓ©."
194 notice_account_deleted: "Votre compte a Γ©tΓ© dΓ©finitivement supprimΓ©."
195 notice_user_successful_create: "Utilisateur %{id} créé."
195 notice_user_successful_create: "Utilisateur %{id} créé."
196
196
197 error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramΓ©trage : %{value}"
197 error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramΓ©trage : %{value}"
198 error_scm_not_found: "L'entrΓ©e et/ou la rΓ©vision demandΓ©e n'existe pas dans le dΓ©pΓ΄t."
198 error_scm_not_found: "L'entrΓ©e et/ou la rΓ©vision demandΓ©e n'existe pas dans le dΓ©pΓ΄t."
199 error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt : %{value}"
199 error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt : %{value}"
200 error_scm_annotate: "L'entrΓ©e n'existe pas ou ne peut pas Γͺtre annotΓ©e."
200 error_scm_annotate: "L'entrΓ©e n'existe pas ou ne peut pas Γͺtre annotΓ©e."
201 error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas Γ  ce projet"
201 error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas Γ  ce projet"
202 error_can_not_reopen_issue_on_closed_version: 'Une demande assignΓ©e Γ  une version fermΓ©e ne peut pas Γͺtre rΓ©ouverte'
202 error_can_not_reopen_issue_on_closed_version: 'Une demande assignΓ©e Γ  une version fermΓ©e ne peut pas Γͺtre rΓ©ouverte'
203 error_can_not_archive_project: "Ce projet ne peut pas Γͺtre archivΓ©"
203 error_can_not_archive_project: "Ce projet ne peut pas Γͺtre archivΓ©"
204 error_workflow_copy_source: 'Veuillez sΓ©lectionner un tracker et/ou un rΓ΄le source'
204 error_workflow_copy_source: 'Veuillez sΓ©lectionner un tracker et/ou un rΓ΄le source'
205 error_workflow_copy_target: 'Veuillez sΓ©lectionner les trackers et rΓ΄les cibles'
205 error_workflow_copy_target: 'Veuillez sΓ©lectionner les trackers et rΓ΄les cibles'
206 error_issue_done_ratios_not_updated: L'avancement des demandes n'a pas pu Γͺtre mis Γ  jour.
206 error_issue_done_ratios_not_updated: L'avancement des demandes n'a pas pu Γͺtre mis Γ  jour.
207 error_attachment_too_big: Ce fichier ne peut pas Γͺtre attachΓ© car il excΓ¨de la taille maximale autorisΓ©e (%{max_size})
207 error_attachment_too_big: Ce fichier ne peut pas Γͺtre attachΓ© car il excΓ¨de la taille maximale autorisΓ©e (%{max_size})
208 error_session_expired: "Votre session a expirΓ©. Veuillez vous reconnecter."
208 error_session_expired: "Votre session a expirΓ©. Veuillez vous reconnecter."
209
209
210 warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu Γͺtre sauvegardΓ©s."
210 warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu Γͺtre sauvegardΓ©s."
211
211
212 mail_subject_lost_password: "Votre mot de passe %{value}"
212 mail_subject_lost_password: "Votre mot de passe %{value}"
213 mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
213 mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
214 mail_subject_register: "Activation de votre compte %{value}"
214 mail_subject_register: "Activation de votre compte %{value}"
215 mail_body_register: 'Pour activer votre compte, cliquez sur le lien suivant :'
215 mail_body_register: 'Pour activer votre compte, cliquez sur le lien suivant :'
216 mail_body_account_information_external: "Vous pouvez utiliser votre compte %{value} pour vous connecter."
216 mail_body_account_information_external: "Vous pouvez utiliser votre compte %{value} pour vous connecter."
217 mail_body_account_information: Paramètres de connexion de votre compte
217 mail_body_account_information: Paramètres de connexion de votre compte
218 mail_subject_account_activation_request: "Demande d'activation d'un compte %{value}"
218 mail_subject_account_activation_request: "Demande d'activation d'un compte %{value}"
219 mail_body_account_activation_request: "Un nouvel utilisateur (%{value}) s'est inscrit. Son compte nΓ©cessite votre approbation :"
219 mail_body_account_activation_request: "Un nouvel utilisateur (%{value}) s'est inscrit. Son compte nΓ©cessite votre approbation :"
220 mail_subject_reminder: "%{count} demande(s) arrivent Γ  Γ©chΓ©ance (%{days})"
220 mail_subject_reminder: "%{count} demande(s) arrivent Γ  Γ©chΓ©ance (%{days})"
221 mail_body_reminder: "%{count} demande(s) qui vous sont assignΓ©es arrivent Γ  Γ©chΓ©ance dans les %{days} prochains jours :"
221 mail_body_reminder: "%{count} demande(s) qui vous sont assignΓ©es arrivent Γ  Γ©chΓ©ance dans les %{days} prochains jours :"
222 mail_subject_wiki_content_added: "Page wiki '%{id}' ajoutΓ©e"
222 mail_subject_wiki_content_added: "Page wiki '%{id}' ajoutΓ©e"
223 mail_body_wiki_content_added: "La page wiki '%{id}' a Γ©tΓ© ajoutΓ©e par %{author}."
223 mail_body_wiki_content_added: "La page wiki '%{id}' a Γ©tΓ© ajoutΓ©e par %{author}."
224 mail_subject_wiki_content_updated: "Page wiki '%{id}' mise Γ  jour"
224 mail_subject_wiki_content_updated: "Page wiki '%{id}' mise Γ  jour"
225 mail_body_wiki_content_updated: "La page wiki '%{id}' a Γ©tΓ© mise Γ  jour par %{author}."
225 mail_body_wiki_content_updated: "La page wiki '%{id}' a Γ©tΓ© mise Γ  jour par %{author}."
226
226
227 gui_validation_error: 1 erreur
227 gui_validation_error: 1 erreur
228 gui_validation_error_plural: "%{count} erreurs"
228 gui_validation_error_plural: "%{count} erreurs"
229
229
230 field_name: Nom
230 field_name: Nom
231 field_description: Description
231 field_description: Description
232 field_summary: RΓ©sumΓ©
232 field_summary: RΓ©sumΓ©
233 field_is_required: Obligatoire
233 field_is_required: Obligatoire
234 field_firstname: PrΓ©nom
234 field_firstname: PrΓ©nom
235 field_lastname: Nom
235 field_lastname: Nom
236 field_mail: "Email "
236 field_mail: "Email "
237 field_filename: Fichier
237 field_filename: Fichier
238 field_filesize: Taille
238 field_filesize: Taille
239 field_downloads: TΓ©lΓ©chargements
239 field_downloads: TΓ©lΓ©chargements
240 field_author: Auteur
240 field_author: Auteur
241 field_created_on: "Créé "
241 field_created_on: "Créé "
242 field_updated_on: "Mis-Γ -jour "
242 field_updated_on: "Mis-Γ -jour "
243 field_field_format: Format
243 field_field_format: Format
244 field_is_for_all: Pour tous les projets
244 field_is_for_all: Pour tous les projets
245 field_possible_values: Valeurs possibles
245 field_possible_values: Valeurs possibles
246 field_regexp: Expression régulière
246 field_regexp: Expression régulière
247 field_min_length: Longueur minimum
247 field_min_length: Longueur minimum
248 field_max_length: Longueur maximum
248 field_max_length: Longueur maximum
249 field_value: Valeur
249 field_value: Valeur
250 field_category: CatΓ©gorie
250 field_category: CatΓ©gorie
251 field_title: Titre
251 field_title: Titre
252 field_project: Projet
252 field_project: Projet
253 field_issue: Demande
253 field_issue: Demande
254 field_status: Statut
254 field_status: Statut
255 field_notes: Notes
255 field_notes: Notes
256 field_is_closed: Demande fermΓ©e
256 field_is_closed: Demande fermΓ©e
257 field_is_default: Valeur par dΓ©faut
257 field_is_default: Valeur par dΓ©faut
258 field_tracker: Tracker
258 field_tracker: Tracker
259 field_subject: Sujet
259 field_subject: Sujet
260 field_due_date: EchΓ©ance
260 field_due_date: EchΓ©ance
261 field_assigned_to: AssignΓ© Γ 
261 field_assigned_to: AssignΓ© Γ 
262 field_priority: PrioritΓ©
262 field_priority: PrioritΓ©
263 field_fixed_version: Version cible
263 field_fixed_version: Version cible
264 field_user: Utilisateur
264 field_user: Utilisateur
265 field_role: RΓ΄le
265 field_role: RΓ΄le
266 field_homepage: "Site web "
266 field_homepage: "Site web "
267 field_is_public: Public
267 field_is_public: Public
268 field_parent: Sous-projet de
268 field_parent: Sous-projet de
269 field_is_in_roadmap: Demandes affichΓ©es dans la roadmap
269 field_is_in_roadmap: Demandes affichΓ©es dans la roadmap
270 field_login: "Identifiant "
270 field_login: "Identifiant "
271 field_mail_notification: Notifications par mail
271 field_mail_notification: Notifications par mail
272 field_admin: Administrateur
272 field_admin: Administrateur
273 field_last_login_on: "Dernière connexion "
273 field_last_login_on: "Dernière connexion "
274 field_language: Langue
274 field_language: Langue
275 field_effective_date: Date
275 field_effective_date: Date
276 field_password: Mot de passe
276 field_password: Mot de passe
277 field_new_password: Nouveau mot de passe
277 field_new_password: Nouveau mot de passe
278 field_password_confirmation: Confirmation
278 field_password_confirmation: Confirmation
279 field_version: Version
279 field_version: Version
280 field_type: Type
280 field_type: Type
281 field_host: HΓ΄te
281 field_host: HΓ΄te
282 field_port: Port
282 field_port: Port
283 field_account: Compte
283 field_account: Compte
284 field_base_dn: Base DN
284 field_base_dn: Base DN
285 field_attr_login: Attribut Identifiant
285 field_attr_login: Attribut Identifiant
286 field_attr_firstname: Attribut PrΓ©nom
286 field_attr_firstname: Attribut PrΓ©nom
287 field_attr_lastname: Attribut Nom
287 field_attr_lastname: Attribut Nom
288 field_attr_mail: Attribut Email
288 field_attr_mail: Attribut Email
289 field_onthefly: CrΓ©ation des utilisateurs Γ  la volΓ©e
289 field_onthefly: CrΓ©ation des utilisateurs Γ  la volΓ©e
290 field_start_date: DΓ©but
290 field_start_date: DΓ©but
291 field_done_ratio: "% rΓ©alisΓ©"
291 field_done_ratio: "% rΓ©alisΓ©"
292 field_auth_source: Mode d'authentification
292 field_auth_source: Mode d'authentification
293 field_hide_mail: Cacher mon adresse mail
293 field_hide_mail: Cacher mon adresse mail
294 field_comments: Commentaire
294 field_comments: Commentaire
295 field_url: URL
295 field_url: URL
296 field_start_page: Page de dΓ©marrage
296 field_start_page: Page de dΓ©marrage
297 field_subproject: Sous-projet
297 field_subproject: Sous-projet
298 field_hours: Heures
298 field_hours: Heures
299 field_activity: ActivitΓ©
299 field_activity: ActivitΓ©
300 field_spent_on: Date
300 field_spent_on: Date
301 field_identifier: Identifiant
301 field_identifier: Identifiant
302 field_is_filter: UtilisΓ© comme filtre
302 field_is_filter: UtilisΓ© comme filtre
303 field_issue_to: Demande liΓ©e
303 field_issue_to: Demande liΓ©e
304 field_delay: Retard
304 field_delay: Retard
305 field_assignable: Demandes assignables Γ  ce rΓ΄le
305 field_assignable: Demandes assignables Γ  ce rΓ΄le
306 field_redirect_existing_links: Rediriger les liens existants
306 field_redirect_existing_links: Rediriger les liens existants
307 field_estimated_hours: Temps estimΓ©
307 field_estimated_hours: Temps estimΓ©
308 field_column_names: Colonnes
308 field_column_names: Colonnes
309 field_time_zone: Fuseau horaire
309 field_time_zone: Fuseau horaire
310 field_searchable: UtilisΓ© pour les recherches
310 field_searchable: UtilisΓ© pour les recherches
311 field_default_value: Valeur par dΓ©faut
311 field_default_value: Valeur par dΓ©faut
312 field_comments_sorting: Afficher les commentaires
312 field_comments_sorting: Afficher les commentaires
313 field_parent_title: Page parent
313 field_parent_title: Page parent
314 field_editable: Modifiable
314 field_editable: Modifiable
315 field_watcher: Observateur
315 field_watcher: Observateur
316 field_identity_url: URL OpenID
316 field_identity_url: URL OpenID
317 field_content: Contenu
317 field_content: Contenu
318 field_group_by: Grouper par
318 field_group_by: Grouper par
319 field_sharing: Partage
319 field_sharing: Partage
320 field_active: Actif
320 field_active: Actif
321 field_parent_issue: TΓ’che parente
321 field_parent_issue: TΓ’che parente
322 field_visible: Visible
322 field_visible: Visible
323 field_warn_on_leaving_unsaved: "M'avertir lorsque je quitte une page contenant du texte non sauvegardΓ©"
323 field_warn_on_leaving_unsaved: "M'avertir lorsque je quitte une page contenant du texte non sauvegardΓ©"
324 field_issues_visibility: VisibilitΓ© des demandes
324 field_issues_visibility: VisibilitΓ© des demandes
325 field_is_private: PrivΓ©e
325 field_is_private: PrivΓ©e
326 field_commit_logs_encoding: Encodage des messages de commit
326 field_commit_logs_encoding: Encodage des messages de commit
327 field_repository_is_default: DΓ©pΓ΄t principal
327 field_repository_is_default: DΓ©pΓ΄t principal
328 field_multiple: Valeurs multiples
328 field_multiple: Valeurs multiples
329 field_auth_source_ldap_filter: Filtre LDAP
329 field_auth_source_ldap_filter: Filtre LDAP
330 field_core_fields: Champs standards
330 field_core_fields: Champs standards
331 field_timeout: "Timeout (en secondes)"
331 field_timeout: "Timeout (en secondes)"
332 field_board_parent: Forum parent
332 field_board_parent: Forum parent
333 field_private_notes: Notes privΓ©es
333 field_private_notes: Notes privΓ©es
334
334
335 setting_app_title: Titre de l'application
335 setting_app_title: Titre de l'application
336 setting_app_subtitle: Sous-titre de l'application
336 setting_app_subtitle: Sous-titre de l'application
337 setting_welcome_text: Texte d'accueil
337 setting_welcome_text: Texte d'accueil
338 setting_default_language: Langue par dΓ©faut
338 setting_default_language: Langue par dΓ©faut
339 setting_login_required: Authentification obligatoire
339 setting_login_required: Authentification obligatoire
340 setting_self_registration: Inscription des nouveaux utilisateurs
340 setting_self_registration: Inscription des nouveaux utilisateurs
341 setting_attachment_max_size: Taille maximale des fichiers
341 setting_attachment_max_size: Taille maximale des fichiers
342 setting_issues_export_limit: Limite d'exportation des demandes
342 setting_issues_export_limit: Limite d'exportation des demandes
343 setting_mail_from: Adresse d'Γ©mission
343 setting_mail_from: Adresse d'Γ©mission
344 setting_bcc_recipients: Destinataires en copie cachΓ©e (cci)
344 setting_bcc_recipients: Destinataires en copie cachΓ©e (cci)
345 setting_plain_text_mail: Mail en texte brut (non HTML)
345 setting_plain_text_mail: Mail en texte brut (non HTML)
346 setting_host_name: Nom d'hΓ΄te et chemin
346 setting_host_name: Nom d'hΓ΄te et chemin
347 setting_text_formatting: Formatage du texte
347 setting_text_formatting: Formatage du texte
348 setting_wiki_compression: Compression de l'historique des pages wiki
348 setting_wiki_compression: Compression de l'historique des pages wiki
349 setting_feeds_limit: Nombre maximal d'Γ©lΓ©ments dans les flux Atom
349 setting_feeds_limit: Nombre maximal d'Γ©lΓ©ments dans les flux Atom
350 setting_default_projects_public: DΓ©finir les nouveaux projets comme publics par dΓ©faut
350 setting_default_projects_public: DΓ©finir les nouveaux projets comme publics par dΓ©faut
351 setting_autofetch_changesets: RΓ©cupΓ©ration automatique des commits
351 setting_autofetch_changesets: RΓ©cupΓ©ration automatique des commits
352 setting_sys_api_enabled: Activer les WS pour la gestion des dΓ©pΓ΄ts
352 setting_sys_api_enabled: Activer les WS pour la gestion des dΓ©pΓ΄ts
353 setting_commit_ref_keywords: Mots-clΓ©s de rΓ©fΓ©rencement
353 setting_commit_ref_keywords: Mots-clΓ©s de rΓ©fΓ©rencement
354 setting_commit_fix_keywords: Mots-clΓ©s de rΓ©solution
354 setting_commit_fix_keywords: Mots-clΓ©s de rΓ©solution
355 setting_autologin: DurΓ©e maximale de connexion automatique
355 setting_autologin: DurΓ©e maximale de connexion automatique
356 setting_date_format: Format de date
356 setting_date_format: Format de date
357 setting_time_format: Format d'heure
357 setting_time_format: Format d'heure
358 setting_cross_project_issue_relations: Autoriser les relations entre demandes de diffΓ©rents projets
358 setting_cross_project_issue_relations: Autoriser les relations entre demandes de diffΓ©rents projets
359 setting_cross_project_subtasks: Autoriser les sous-tΓ’ches dans des projets diffΓ©rents
359 setting_issue_list_default_columns: Colonnes affichΓ©es par dΓ©faut sur la liste des demandes
360 setting_issue_list_default_columns: Colonnes affichΓ©es par dΓ©faut sur la liste des demandes
360 setting_emails_footer: Pied-de-page des emails
361 setting_emails_footer: Pied-de-page des emails
361 setting_protocol: Protocole
362 setting_protocol: Protocole
362 setting_per_page_options: Options d'objets affichΓ©s par page
363 setting_per_page_options: Options d'objets affichΓ©s par page
363 setting_user_format: Format d'affichage des utilisateurs
364 setting_user_format: Format d'affichage des utilisateurs
364 setting_activity_days_default: Nombre de jours affichΓ©s sur l'activitΓ© des projets
365 setting_activity_days_default: Nombre de jours affichΓ©s sur l'activitΓ© des projets
365 setting_display_subprojects_issues: Afficher par dΓ©faut les demandes des sous-projets sur les projets principaux
366 setting_display_subprojects_issues: Afficher par dΓ©faut les demandes des sous-projets sur les projets principaux
366 setting_enabled_scm: SCM activΓ©s
367 setting_enabled_scm: SCM activΓ©s
367 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
368 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
368 setting_mail_handler_api_enabled: "Activer le WS pour la rΓ©ception d'emails"
369 setting_mail_handler_api_enabled: "Activer le WS pour la rΓ©ception d'emails"
369 setting_mail_handler_api_key: ClΓ© de protection de l'API
370 setting_mail_handler_api_key: ClΓ© de protection de l'API
370 setting_sequential_project_identifiers: GΓ©nΓ©rer des identifiants de projet sΓ©quentiels
371 setting_sequential_project_identifiers: GΓ©nΓ©rer des identifiants de projet sΓ©quentiels
371 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
372 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
372 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichΓ©es
373 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichΓ©es
373 setting_file_max_size_displayed: Taille maximum des fichiers texte affichΓ©s en ligne
374 setting_file_max_size_displayed: Taille maximum des fichiers texte affichΓ©s en ligne
374 setting_repository_log_display_limit: "Nombre maximum de rΓ©visions affichΓ©es sur l'historique d'un fichier"
375 setting_repository_log_display_limit: "Nombre maximum de rΓ©visions affichΓ©es sur l'historique d'un fichier"
375 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
376 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
376 setting_password_min_length: Longueur minimum des mots de passe
377 setting_password_min_length: Longueur minimum des mots de passe
377 setting_new_project_user_role_id: RΓ΄le donnΓ© Γ  un utilisateur non-administrateur qui crΓ©e un projet
378 setting_new_project_user_role_id: RΓ΄le donnΓ© Γ  un utilisateur non-administrateur qui crΓ©e un projet
378 setting_default_projects_modules: Modules activΓ©s par dΓ©faut pour les nouveaux projets
379 setting_default_projects_modules: Modules activΓ©s par dΓ©faut pour les nouveaux projets
379 setting_issue_done_ratio: Calcul de l'avancement des demandes
380 setting_issue_done_ratio: Calcul de l'avancement des demandes
380 setting_issue_done_ratio_issue_status: Utiliser le statut
381 setting_issue_done_ratio_issue_status: Utiliser le statut
381 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectuΓ©'
382 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectuΓ©'
382 setting_rest_api_enabled: Activer l'API REST
383 setting_rest_api_enabled: Activer l'API REST
383 setting_gravatar_default: Image Gravatar par dΓ©faut
384 setting_gravatar_default: Image Gravatar par dΓ©faut
384 setting_start_of_week: Jour de dΓ©but des calendriers
385 setting_start_of_week: Jour de dΓ©but des calendriers
385 setting_cache_formatted_text: Mettre en cache le texte formatΓ©
386 setting_cache_formatted_text: Mettre en cache le texte formatΓ©
386 setting_commit_logtime_enabled: Permettre la saisie de temps
387 setting_commit_logtime_enabled: Permettre la saisie de temps
387 setting_commit_logtime_activity_id: ActivitΓ© pour le temps saisi
388 setting_commit_logtime_activity_id: ActivitΓ© pour le temps saisi
388 setting_gantt_items_limit: Nombre maximum d'Γ©lΓ©ments affichΓ©s sur le gantt
389 setting_gantt_items_limit: Nombre maximum d'Γ©lΓ©ments affichΓ©s sur le gantt
389 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
390 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
390 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
391 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
391 setting_commit_cross_project_ref: Permettre le rΓ©fΓ©rencement et la rΓ©solution des demandes de tous les autres projets
392 setting_commit_cross_project_ref: Permettre le rΓ©fΓ©rencement et la rΓ©solution des demandes de tous les autres projets
392 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
393 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
393 setting_session_lifetime: DurΓ©e de vie maximale des sessions
394 setting_session_lifetime: DurΓ©e de vie maximale des sessions
394 setting_session_timeout: DurΓ©e maximale d'inactivitΓ©
395 setting_session_timeout: DurΓ©e maximale d'inactivitΓ©
395 setting_thumbnails_enabled: Afficher les vignettes des images
396 setting_thumbnails_enabled: Afficher les vignettes des images
396 setting_thumbnails_size: Taille des vignettes (en pixels)
397 setting_thumbnails_size: Taille des vignettes (en pixels)
397
398
398 permission_add_project: CrΓ©er un projet
399 permission_add_project: CrΓ©er un projet
399 permission_add_subprojects: CrΓ©er des sous-projets
400 permission_add_subprojects: CrΓ©er des sous-projets
400 permission_edit_project: Modifier le projet
401 permission_edit_project: Modifier le projet
401 permission_close_project: Fermer / rΓ©ouvrir le projet
402 permission_close_project: Fermer / rΓ©ouvrir le projet
402 permission_select_project_modules: Choisir les modules
403 permission_select_project_modules: Choisir les modules
403 permission_manage_members: GΓ©rer les membres
404 permission_manage_members: GΓ©rer les membres
404 permission_manage_versions: GΓ©rer les versions
405 permission_manage_versions: GΓ©rer les versions
405 permission_manage_categories: GΓ©rer les catΓ©gories de demandes
406 permission_manage_categories: GΓ©rer les catΓ©gories de demandes
406 permission_view_issues: Voir les demandes
407 permission_view_issues: Voir les demandes
407 permission_add_issues: CrΓ©er des demandes
408 permission_add_issues: CrΓ©er des demandes
408 permission_edit_issues: Modifier les demandes
409 permission_edit_issues: Modifier les demandes
409 permission_manage_issue_relations: GΓ©rer les relations
410 permission_manage_issue_relations: GΓ©rer les relations
410 permission_set_issues_private: Rendre les demandes publiques ou privΓ©es
411 permission_set_issues_private: Rendre les demandes publiques ou privΓ©es
411 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privΓ©es
412 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privΓ©es
412 permission_add_issue_notes: Ajouter des notes
413 permission_add_issue_notes: Ajouter des notes
413 permission_edit_issue_notes: Modifier les notes
414 permission_edit_issue_notes: Modifier les notes
414 permission_edit_own_issue_notes: Modifier ses propres notes
415 permission_edit_own_issue_notes: Modifier ses propres notes
415 permission_view_private_notes: Voir les notes privΓ©es
416 permission_view_private_notes: Voir les notes privΓ©es
416 permission_set_notes_private: Rendre les notes privΓ©es
417 permission_set_notes_private: Rendre les notes privΓ©es
417 permission_move_issues: DΓ©placer les demandes
418 permission_move_issues: DΓ©placer les demandes
418 permission_delete_issues: Supprimer les demandes
419 permission_delete_issues: Supprimer les demandes
419 permission_manage_public_queries: GΓ©rer les requΓͺtes publiques
420 permission_manage_public_queries: GΓ©rer les requΓͺtes publiques
420 permission_save_queries: Sauvegarder les requΓͺtes
421 permission_save_queries: Sauvegarder les requΓͺtes
421 permission_view_gantt: Voir le gantt
422 permission_view_gantt: Voir le gantt
422 permission_view_calendar: Voir le calendrier
423 permission_view_calendar: Voir le calendrier
423 permission_view_issue_watchers: Voir la liste des observateurs
424 permission_view_issue_watchers: Voir la liste des observateurs
424 permission_add_issue_watchers: Ajouter des observateurs
425 permission_add_issue_watchers: Ajouter des observateurs
425 permission_delete_issue_watchers: Supprimer des observateurs
426 permission_delete_issue_watchers: Supprimer des observateurs
426 permission_log_time: Saisir le temps passΓ©
427 permission_log_time: Saisir le temps passΓ©
427 permission_view_time_entries: Voir le temps passΓ©
428 permission_view_time_entries: Voir le temps passΓ©
428 permission_edit_time_entries: Modifier les temps passΓ©s
429 permission_edit_time_entries: Modifier les temps passΓ©s
429 permission_edit_own_time_entries: Modifier son propre temps passΓ©
430 permission_edit_own_time_entries: Modifier son propre temps passΓ©
430 permission_manage_news: GΓ©rer les annonces
431 permission_manage_news: GΓ©rer les annonces
431 permission_comment_news: Commenter les annonces
432 permission_comment_news: Commenter les annonces
432 permission_manage_documents: GΓ©rer les documents
433 permission_manage_documents: GΓ©rer les documents
433 permission_view_documents: Voir les documents
434 permission_view_documents: Voir les documents
434 permission_manage_files: GΓ©rer les fichiers
435 permission_manage_files: GΓ©rer les fichiers
435 permission_view_files: Voir les fichiers
436 permission_view_files: Voir les fichiers
436 permission_manage_wiki: GΓ©rer le wiki
437 permission_manage_wiki: GΓ©rer le wiki
437 permission_rename_wiki_pages: Renommer les pages
438 permission_rename_wiki_pages: Renommer les pages
438 permission_delete_wiki_pages: Supprimer les pages
439 permission_delete_wiki_pages: Supprimer les pages
439 permission_view_wiki_pages: Voir le wiki
440 permission_view_wiki_pages: Voir le wiki
440 permission_view_wiki_edits: "Voir l'historique des modifications"
441 permission_view_wiki_edits: "Voir l'historique des modifications"
441 permission_edit_wiki_pages: Modifier les pages
442 permission_edit_wiki_pages: Modifier les pages
442 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
443 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
443 permission_protect_wiki_pages: ProtΓ©ger les pages
444 permission_protect_wiki_pages: ProtΓ©ger les pages
444 permission_manage_repository: GΓ©rer le dΓ©pΓ΄t de sources
445 permission_manage_repository: GΓ©rer le dΓ©pΓ΄t de sources
445 permission_browse_repository: Parcourir les sources
446 permission_browse_repository: Parcourir les sources
446 permission_view_changesets: Voir les rΓ©visions
447 permission_view_changesets: Voir les rΓ©visions
447 permission_commit_access: Droit de commit
448 permission_commit_access: Droit de commit
448 permission_manage_boards: GΓ©rer les forums
449 permission_manage_boards: GΓ©rer les forums
449 permission_view_messages: Voir les messages
450 permission_view_messages: Voir les messages
450 permission_add_messages: Poster un message
451 permission_add_messages: Poster un message
451 permission_edit_messages: Modifier les messages
452 permission_edit_messages: Modifier les messages
452 permission_edit_own_messages: Modifier ses propres messages
453 permission_edit_own_messages: Modifier ses propres messages
453 permission_delete_messages: Supprimer les messages
454 permission_delete_messages: Supprimer les messages
454 permission_delete_own_messages: Supprimer ses propres messages
455 permission_delete_own_messages: Supprimer ses propres messages
455 permission_export_wiki_pages: Exporter les pages
456 permission_export_wiki_pages: Exporter les pages
456 permission_manage_project_activities: GΓ©rer les activitΓ©s
457 permission_manage_project_activities: GΓ©rer les activitΓ©s
457 permission_manage_subtasks: GΓ©rer les sous-tΓ’ches
458 permission_manage_subtasks: GΓ©rer les sous-tΓ’ches
458 permission_manage_related_issues: GΓ©rer les demandes associΓ©es
459 permission_manage_related_issues: GΓ©rer les demandes associΓ©es
459
460
460 project_module_issue_tracking: Suivi des demandes
461 project_module_issue_tracking: Suivi des demandes
461 project_module_time_tracking: Suivi du temps passΓ©
462 project_module_time_tracking: Suivi du temps passΓ©
462 project_module_news: Publication d'annonces
463 project_module_news: Publication d'annonces
463 project_module_documents: Publication de documents
464 project_module_documents: Publication de documents
464 project_module_files: Publication de fichiers
465 project_module_files: Publication de fichiers
465 project_module_wiki: Wiki
466 project_module_wiki: Wiki
466 project_module_repository: DΓ©pΓ΄t de sources
467 project_module_repository: DΓ©pΓ΄t de sources
467 project_module_boards: Forums de discussion
468 project_module_boards: Forums de discussion
468
469
469 label_user: Utilisateur
470 label_user: Utilisateur
470 label_user_plural: Utilisateurs
471 label_user_plural: Utilisateurs
471 label_user_new: Nouvel utilisateur
472 label_user_new: Nouvel utilisateur
472 label_user_anonymous: Anonyme
473 label_user_anonymous: Anonyme
473 label_project: Projet
474 label_project: Projet
474 label_project_new: Nouveau projet
475 label_project_new: Nouveau projet
475 label_project_plural: Projets
476 label_project_plural: Projets
476 label_x_projects:
477 label_x_projects:
477 zero: aucun projet
478 zero: aucun projet
478 one: un projet
479 one: un projet
479 other: "%{count} projets"
480 other: "%{count} projets"
480 label_project_all: Tous les projets
481 label_project_all: Tous les projets
481 label_project_latest: Derniers projets
482 label_project_latest: Derniers projets
482 label_issue: Demande
483 label_issue: Demande
483 label_issue_new: Nouvelle demande
484 label_issue_new: Nouvelle demande
484 label_issue_plural: Demandes
485 label_issue_plural: Demandes
485 label_issue_view_all: Voir toutes les demandes
486 label_issue_view_all: Voir toutes les demandes
486 label_issue_added: Demande ajoutΓ©e
487 label_issue_added: Demande ajoutΓ©e
487 label_issue_updated: Demande mise Γ  jour
488 label_issue_updated: Demande mise Γ  jour
488 label_issue_note_added: Note ajoutΓ©e
489 label_issue_note_added: Note ajoutΓ©e
489 label_issue_status_updated: Statut changΓ©
490 label_issue_status_updated: Statut changΓ©
490 label_issue_priority_updated: PrioritΓ© changΓ©e
491 label_issue_priority_updated: PrioritΓ© changΓ©e
491 label_issues_by: "Demandes par %{value}"
492 label_issues_by: "Demandes par %{value}"
492 label_document: Document
493 label_document: Document
493 label_document_new: Nouveau document
494 label_document_new: Nouveau document
494 label_document_plural: Documents
495 label_document_plural: Documents
495 label_document_added: Document ajoutΓ©
496 label_document_added: Document ajoutΓ©
496 label_role: RΓ΄le
497 label_role: RΓ΄le
497 label_role_plural: RΓ΄les
498 label_role_plural: RΓ΄les
498 label_role_new: Nouveau rΓ΄le
499 label_role_new: Nouveau rΓ΄le
499 label_role_and_permissions: RΓ΄les et permissions
500 label_role_and_permissions: RΓ΄les et permissions
500 label_role_anonymous: Anonyme
501 label_role_anonymous: Anonyme
501 label_role_non_member: Non membre
502 label_role_non_member: Non membre
502 label_member: Membre
503 label_member: Membre
503 label_member_new: Nouveau membre
504 label_member_new: Nouveau membre
504 label_member_plural: Membres
505 label_member_plural: Membres
505 label_tracker: Tracker
506 label_tracker: Tracker
506 label_tracker_plural: Trackers
507 label_tracker_plural: Trackers
507 label_tracker_new: Nouveau tracker
508 label_tracker_new: Nouveau tracker
508 label_workflow: Workflow
509 label_workflow: Workflow
509 label_issue_status: Statut de demandes
510 label_issue_status: Statut de demandes
510 label_issue_status_plural: Statuts de demandes
511 label_issue_status_plural: Statuts de demandes
511 label_issue_status_new: Nouveau statut
512 label_issue_status_new: Nouveau statut
512 label_issue_category: CatΓ©gorie de demandes
513 label_issue_category: CatΓ©gorie de demandes
513 label_issue_category_plural: CatΓ©gories de demandes
514 label_issue_category_plural: CatΓ©gories de demandes
514 label_issue_category_new: Nouvelle catΓ©gorie
515 label_issue_category_new: Nouvelle catΓ©gorie
515 label_custom_field: Champ personnalisΓ©
516 label_custom_field: Champ personnalisΓ©
516 label_custom_field_plural: Champs personnalisΓ©s
517 label_custom_field_plural: Champs personnalisΓ©s
517 label_custom_field_new: Nouveau champ personnalisΓ©
518 label_custom_field_new: Nouveau champ personnalisΓ©
518 label_enumerations: Listes de valeurs
519 label_enumerations: Listes de valeurs
519 label_enumeration_new: Nouvelle valeur
520 label_enumeration_new: Nouvelle valeur
520 label_information: Information
521 label_information: Information
521 label_information_plural: Informations
522 label_information_plural: Informations
522 label_please_login: Identification
523 label_please_login: Identification
523 label_register: S'enregistrer
524 label_register: S'enregistrer
524 label_login_with_open_id_option: S'authentifier avec OpenID
525 label_login_with_open_id_option: S'authentifier avec OpenID
525 label_password_lost: Mot de passe perdu
526 label_password_lost: Mot de passe perdu
526 label_home: Accueil
527 label_home: Accueil
527 label_my_page: Ma page
528 label_my_page: Ma page
528 label_my_account: Mon compte
529 label_my_account: Mon compte
529 label_my_projects: Mes projets
530 label_my_projects: Mes projets
530 label_my_page_block: Blocs disponibles
531 label_my_page_block: Blocs disponibles
531 label_administration: Administration
532 label_administration: Administration
532 label_login: Connexion
533 label_login: Connexion
533 label_logout: DΓ©connexion
534 label_logout: DΓ©connexion
534 label_help: Aide
535 label_help: Aide
535 label_reported_issues: "Demandes soumises "
536 label_reported_issues: "Demandes soumises "
536 label_assigned_to_me_issues: Demandes qui me sont assignΓ©es
537 label_assigned_to_me_issues: Demandes qui me sont assignΓ©es
537 label_last_login: "Dernière connexion "
538 label_last_login: "Dernière connexion "
538 label_registered_on: "Inscrit le "
539 label_registered_on: "Inscrit le "
539 label_activity: ActivitΓ©
540 label_activity: ActivitΓ©
540 label_overall_activity: ActivitΓ© globale
541 label_overall_activity: ActivitΓ© globale
541 label_user_activity: "ActivitΓ© de %{value}"
542 label_user_activity: "ActivitΓ© de %{value}"
542 label_new: Nouveau
543 label_new: Nouveau
543 label_logged_as: ConnectΓ© en tant que
544 label_logged_as: ConnectΓ© en tant que
544 label_environment: Environnement
545 label_environment: Environnement
545 label_authentication: Authentification
546 label_authentication: Authentification
546 label_auth_source: Mode d'authentification
547 label_auth_source: Mode d'authentification
547 label_auth_source_new: Nouveau mode d'authentification
548 label_auth_source_new: Nouveau mode d'authentification
548 label_auth_source_plural: Modes d'authentification
549 label_auth_source_plural: Modes d'authentification
549 label_subproject_plural: Sous-projets
550 label_subproject_plural: Sous-projets
550 label_subproject_new: Nouveau sous-projet
551 label_subproject_new: Nouveau sous-projet
551 label_and_its_subprojects: "%{value} et ses sous-projets"
552 label_and_its_subprojects: "%{value} et ses sous-projets"
552 label_min_max_length: Longueurs mini - maxi
553 label_min_max_length: Longueurs mini - maxi
553 label_list: Liste
554 label_list: Liste
554 label_date: Date
555 label_date: Date
555 label_integer: Entier
556 label_integer: Entier
556 label_float: Nombre dΓ©cimal
557 label_float: Nombre dΓ©cimal
557 label_boolean: BoolΓ©en
558 label_boolean: BoolΓ©en
558 label_string: Texte
559 label_string: Texte
559 label_text: Texte long
560 label_text: Texte long
560 label_attribute: Attribut
561 label_attribute: Attribut
561 label_attribute_plural: Attributs
562 label_attribute_plural: Attributs
562 label_download: "%{count} tΓ©lΓ©chargement"
563 label_download: "%{count} tΓ©lΓ©chargement"
563 label_download_plural: "%{count} tΓ©lΓ©chargements"
564 label_download_plural: "%{count} tΓ©lΓ©chargements"
564 label_no_data: Aucune donnΓ©e Γ  afficher
565 label_no_data: Aucune donnΓ©e Γ  afficher
565 label_change_status: Changer le statut
566 label_change_status: Changer le statut
566 label_history: Historique
567 label_history: Historique
567 label_attachment: Fichier
568 label_attachment: Fichier
568 label_attachment_new: Nouveau fichier
569 label_attachment_new: Nouveau fichier
569 label_attachment_delete: Supprimer le fichier
570 label_attachment_delete: Supprimer le fichier
570 label_attachment_plural: Fichiers
571 label_attachment_plural: Fichiers
571 label_file_added: Fichier ajoutΓ©
572 label_file_added: Fichier ajoutΓ©
572 label_report: Rapport
573 label_report: Rapport
573 label_report_plural: Rapports
574 label_report_plural: Rapports
574 label_news: Annonce
575 label_news: Annonce
575 label_news_new: Nouvelle annonce
576 label_news_new: Nouvelle annonce
576 label_news_plural: Annonces
577 label_news_plural: Annonces
577 label_news_latest: Dernières annonces
578 label_news_latest: Dernières annonces
578 label_news_view_all: Voir toutes les annonces
579 label_news_view_all: Voir toutes les annonces
579 label_news_added: Annonce ajoutΓ©e
580 label_news_added: Annonce ajoutΓ©e
580 label_news_comment_added: Commentaire ajoutΓ© Γ  une annonce
581 label_news_comment_added: Commentaire ajoutΓ© Γ  une annonce
581 label_settings: Configuration
582 label_settings: Configuration
582 label_overview: AperΓ§u
583 label_overview: AperΓ§u
583 label_version: Version
584 label_version: Version
584 label_version_new: Nouvelle version
585 label_version_new: Nouvelle version
585 label_version_plural: Versions
586 label_version_plural: Versions
586 label_confirmation: Confirmation
587 label_confirmation: Confirmation
587 label_export_to: 'Formats disponibles :'
588 label_export_to: 'Formats disponibles :'
588 label_read: Lire...
589 label_read: Lire...
589 label_public_projects: Projets publics
590 label_public_projects: Projets publics
590 label_open_issues: ouvert
591 label_open_issues: ouvert
591 label_open_issues_plural: ouverts
592 label_open_issues_plural: ouverts
592 label_closed_issues: fermΓ©
593 label_closed_issues: fermΓ©
593 label_closed_issues_plural: fermΓ©s
594 label_closed_issues_plural: fermΓ©s
594 label_x_open_issues_abbr_on_total:
595 label_x_open_issues_abbr_on_total:
595 zero: 0 ouverte sur %{total}
596 zero: 0 ouverte sur %{total}
596 one: 1 ouverte sur %{total}
597 one: 1 ouverte sur %{total}
597 other: "%{count} ouvertes sur %{total}"
598 other: "%{count} ouvertes sur %{total}"
598 label_x_open_issues_abbr:
599 label_x_open_issues_abbr:
599 zero: 0 ouverte
600 zero: 0 ouverte
600 one: 1 ouverte
601 one: 1 ouverte
601 other: "%{count} ouvertes"
602 other: "%{count} ouvertes"
602 label_x_closed_issues_abbr:
603 label_x_closed_issues_abbr:
603 zero: 0 fermΓ©e
604 zero: 0 fermΓ©e
604 one: 1 fermΓ©e
605 one: 1 fermΓ©e
605 other: "%{count} fermΓ©es"
606 other: "%{count} fermΓ©es"
606 label_x_issues:
607 label_x_issues:
607 zero: 0 demande
608 zero: 0 demande
608 one: 1 demande
609 one: 1 demande
609 other: "%{count} demandes"
610 other: "%{count} demandes"
610 label_total: Total
611 label_total: Total
611 label_permissions: Permissions
612 label_permissions: Permissions
612 label_current_status: Statut actuel
613 label_current_status: Statut actuel
613 label_new_statuses_allowed: Nouveaux statuts autorisΓ©s
614 label_new_statuses_allowed: Nouveaux statuts autorisΓ©s
614 label_all: tous
615 label_all: tous
615 label_any: tous
616 label_any: tous
616 label_none: aucun
617 label_none: aucun
617 label_nobody: personne
618 label_nobody: personne
618 label_next: Suivant
619 label_next: Suivant
619 label_previous: PrΓ©cΓ©dent
620 label_previous: PrΓ©cΓ©dent
620 label_used_by: UtilisΓ© par
621 label_used_by: UtilisΓ© par
621 label_details: DΓ©tails
622 label_details: DΓ©tails
622 label_add_note: Ajouter une note
623 label_add_note: Ajouter une note
623 label_per_page: Par page
624 label_per_page: Par page
624 label_calendar: Calendrier
625 label_calendar: Calendrier
625 label_months_from: mois depuis
626 label_months_from: mois depuis
626 label_gantt: Gantt
627 label_gantt: Gantt
627 label_internal: Interne
628 label_internal: Interne
628 label_last_changes: "%{count} derniers changements"
629 label_last_changes: "%{count} derniers changements"
629 label_change_view_all: Voir tous les changements
630 label_change_view_all: Voir tous les changements
630 label_personalize_page: Personnaliser cette page
631 label_personalize_page: Personnaliser cette page
631 label_comment: Commentaire
632 label_comment: Commentaire
632 label_comment_plural: Commentaires
633 label_comment_plural: Commentaires
633 label_x_comments:
634 label_x_comments:
634 zero: aucun commentaire
635 zero: aucun commentaire
635 one: un commentaire
636 one: un commentaire
636 other: "%{count} commentaires"
637 other: "%{count} commentaires"
637 label_comment_add: Ajouter un commentaire
638 label_comment_add: Ajouter un commentaire
638 label_comment_added: Commentaire ajoutΓ©
639 label_comment_added: Commentaire ajoutΓ©
639 label_comment_delete: Supprimer les commentaires
640 label_comment_delete: Supprimer les commentaires
640 label_query: Rapport personnalisΓ©
641 label_query: Rapport personnalisΓ©
641 label_query_plural: Rapports personnalisΓ©s
642 label_query_plural: Rapports personnalisΓ©s
642 label_query_new: Nouveau rapport
643 label_query_new: Nouveau rapport
643 label_my_queries: Mes rapports personnalisΓ©s
644 label_my_queries: Mes rapports personnalisΓ©s
644 label_filter_add: "Ajouter le filtre "
645 label_filter_add: "Ajouter le filtre "
645 label_filter_plural: Filtres
646 label_filter_plural: Filtres
646 label_equals: Γ©gal
647 label_equals: Γ©gal
647 label_not_equals: diffΓ©rent
648 label_not_equals: diffΓ©rent
648 label_in_less_than: dans moins de
649 label_in_less_than: dans moins de
649 label_in_more_than: dans plus de
650 label_in_more_than: dans plus de
650 label_in: dans
651 label_in: dans
651 label_today: aujourd'hui
652 label_today: aujourd'hui
652 label_all_time: toute la pΓ©riode
653 label_all_time: toute la pΓ©riode
653 label_yesterday: hier
654 label_yesterday: hier
654 label_this_week: cette semaine
655 label_this_week: cette semaine
655 label_last_week: la semaine dernière
656 label_last_week: la semaine dernière
656 label_last_n_weeks: "les %{count} dernières semaines"
657 label_last_n_weeks: "les %{count} dernières semaines"
657 label_last_n_days: "les %{count} derniers jours"
658 label_last_n_days: "les %{count} derniers jours"
658 label_this_month: ce mois-ci
659 label_this_month: ce mois-ci
659 label_last_month: le mois dernier
660 label_last_month: le mois dernier
660 label_this_year: cette annΓ©e
661 label_this_year: cette annΓ©e
661 label_date_range: PΓ©riode
662 label_date_range: PΓ©riode
662 label_less_than_ago: il y a moins de
663 label_less_than_ago: il y a moins de
663 label_more_than_ago: il y a plus de
664 label_more_than_ago: il y a plus de
664 label_ago: il y a
665 label_ago: il y a
665 label_contains: contient
666 label_contains: contient
666 label_not_contains: ne contient pas
667 label_not_contains: ne contient pas
667 label_any_issues_in_project: une demande du projet
668 label_any_issues_in_project: une demande du projet
668 label_any_issues_not_in_project: une demande hors du projet
669 label_any_issues_not_in_project: une demande hors du projet
669 label_no_issues_in_project: aucune demande du projet
670 label_no_issues_in_project: aucune demande du projet
670 label_day_plural: jours
671 label_day_plural: jours
671 label_repository: DΓ©pΓ΄t
672 label_repository: DΓ©pΓ΄t
672 label_repository_new: Nouveau dΓ©pΓ΄t
673 label_repository_new: Nouveau dΓ©pΓ΄t
673 label_repository_plural: DΓ©pΓ΄ts
674 label_repository_plural: DΓ©pΓ΄ts
674 label_browse: Parcourir
675 label_browse: Parcourir
675 label_modification: "%{count} modification"
676 label_modification: "%{count} modification"
676 label_modification_plural: "%{count} modifications"
677 label_modification_plural: "%{count} modifications"
677 label_revision: "RΓ©vision "
678 label_revision: "RΓ©vision "
678 label_revision_plural: RΓ©visions
679 label_revision_plural: RΓ©visions
679 label_associated_revisions: RΓ©visions associΓ©es
680 label_associated_revisions: RΓ©visions associΓ©es
680 label_added: ajoutΓ©
681 label_added: ajoutΓ©
681 label_modified: modifiΓ©
682 label_modified: modifiΓ©
682 label_copied: copiΓ©
683 label_copied: copiΓ©
683 label_renamed: renommΓ©
684 label_renamed: renommΓ©
684 label_deleted: supprimΓ©
685 label_deleted: supprimΓ©
685 label_latest_revision: Dernière révision
686 label_latest_revision: Dernière révision
686 label_latest_revision_plural: Dernières révisions
687 label_latest_revision_plural: Dernières révisions
687 label_view_revisions: Voir les rΓ©visions
688 label_view_revisions: Voir les rΓ©visions
688 label_max_size: Taille maximale
689 label_max_size: Taille maximale
689 label_sort_highest: Remonter en premier
690 label_sort_highest: Remonter en premier
690 label_sort_higher: Remonter
691 label_sort_higher: Remonter
691 label_sort_lower: Descendre
692 label_sort_lower: Descendre
692 label_sort_lowest: Descendre en dernier
693 label_sort_lowest: Descendre en dernier
693 label_roadmap: Roadmap
694 label_roadmap: Roadmap
694 label_roadmap_due_in: "Γ‰chΓ©ance dans %{value}"
695 label_roadmap_due_in: "Γ‰chΓ©ance dans %{value}"
695 label_roadmap_overdue: "En retard de %{value}"
696 label_roadmap_overdue: "En retard de %{value}"
696 label_roadmap_no_issues: Aucune demande pour cette version
697 label_roadmap_no_issues: Aucune demande pour cette version
697 label_search: "Recherche "
698 label_search: "Recherche "
698 label_result_plural: RΓ©sultats
699 label_result_plural: RΓ©sultats
699 label_all_words: Tous les mots
700 label_all_words: Tous les mots
700 label_wiki: Wiki
701 label_wiki: Wiki
701 label_wiki_edit: RΓ©vision wiki
702 label_wiki_edit: RΓ©vision wiki
702 label_wiki_edit_plural: RΓ©visions wiki
703 label_wiki_edit_plural: RΓ©visions wiki
703 label_wiki_page: Page wiki
704 label_wiki_page: Page wiki
704 label_wiki_page_plural: Pages wiki
705 label_wiki_page_plural: Pages wiki
705 label_index_by_title: Index par titre
706 label_index_by_title: Index par titre
706 label_index_by_date: Index par date
707 label_index_by_date: Index par date
707 label_current_version: Version actuelle
708 label_current_version: Version actuelle
708 label_preview: PrΓ©visualisation
709 label_preview: PrΓ©visualisation
709 label_feed_plural: Flux RSS
710 label_feed_plural: Flux RSS
710 label_changes_details: DΓ©tails de tous les changements
711 label_changes_details: DΓ©tails de tous les changements
711 label_issue_tracking: Suivi des demandes
712 label_issue_tracking: Suivi des demandes
712 label_spent_time: Temps passΓ©
713 label_spent_time: Temps passΓ©
713 label_f_hour: "%{value} heure"
714 label_f_hour: "%{value} heure"
714 label_f_hour_plural: "%{value} heures"
715 label_f_hour_plural: "%{value} heures"
715 label_time_tracking: Suivi du temps
716 label_time_tracking: Suivi du temps
716 label_change_plural: Changements
717 label_change_plural: Changements
717 label_statistics: Statistiques
718 label_statistics: Statistiques
718 label_commits_per_month: Commits par mois
719 label_commits_per_month: Commits par mois
719 label_commits_per_author: Commits par auteur
720 label_commits_per_author: Commits par auteur
720 label_view_diff: Voir les diffΓ©rences
721 label_view_diff: Voir les diffΓ©rences
721 label_diff_inline: en ligne
722 label_diff_inline: en ligne
722 label_diff_side_by_side: cΓ΄te Γ  cΓ΄te
723 label_diff_side_by_side: cΓ΄te Γ  cΓ΄te
723 label_options: Options
724 label_options: Options
724 label_copy_workflow_from: Copier le workflow de
725 label_copy_workflow_from: Copier le workflow de
725 label_permissions_report: Synthèse des permissions
726 label_permissions_report: Synthèse des permissions
726 label_watched_issues: Demandes surveillΓ©es
727 label_watched_issues: Demandes surveillΓ©es
727 label_related_issues: Demandes liΓ©es
728 label_related_issues: Demandes liΓ©es
728 label_applied_status: Statut appliquΓ©
729 label_applied_status: Statut appliquΓ©
729 label_loading: Chargement...
730 label_loading: Chargement...
730 label_relation_new: Nouvelle relation
731 label_relation_new: Nouvelle relation
731 label_relation_delete: Supprimer la relation
732 label_relation_delete: Supprimer la relation
732 label_relates_to: LiΓ© Γ 
733 label_relates_to: LiΓ© Γ 
733 label_duplicates: Duplique
734 label_duplicates: Duplique
734 label_duplicated_by: DupliquΓ© par
735 label_duplicated_by: DupliquΓ© par
735 label_blocks: Bloque
736 label_blocks: Bloque
736 label_blocked_by: BloquΓ© par
737 label_blocked_by: BloquΓ© par
737 label_precedes: Précède
738 label_precedes: Précède
738 label_follows: Suit
739 label_follows: Suit
739 label_copied_to: CopiΓ© vers
740 label_copied_to: CopiΓ© vers
740 label_copied_from: CopiΓ© depuis
741 label_copied_from: CopiΓ© depuis
741 label_end_to_start: fin Γ  dΓ©but
742 label_end_to_start: fin Γ  dΓ©but
742 label_end_to_end: fin Γ  fin
743 label_end_to_end: fin Γ  fin
743 label_start_to_start: dΓ©but Γ  dΓ©but
744 label_start_to_start: dΓ©but Γ  dΓ©but
744 label_start_to_end: dΓ©but Γ  fin
745 label_start_to_end: dΓ©but Γ  fin
745 label_stay_logged_in: Rester connectΓ©
746 label_stay_logged_in: Rester connectΓ©
746 label_disabled: dΓ©sactivΓ©
747 label_disabled: dΓ©sactivΓ©
747 label_show_completed_versions: Voir les versions passΓ©es
748 label_show_completed_versions: Voir les versions passΓ©es
748 label_me: moi
749 label_me: moi
749 label_board: Forum
750 label_board: Forum
750 label_board_new: Nouveau forum
751 label_board_new: Nouveau forum
751 label_board_plural: Forums
752 label_board_plural: Forums
752 label_topic_plural: Discussions
753 label_topic_plural: Discussions
753 label_message_plural: Messages
754 label_message_plural: Messages
754 label_message_last: Dernier message
755 label_message_last: Dernier message
755 label_message_new: Nouveau message
756 label_message_new: Nouveau message
756 label_message_posted: Message ajoutΓ©
757 label_message_posted: Message ajoutΓ©
757 label_reply_plural: RΓ©ponses
758 label_reply_plural: RΓ©ponses
758 label_send_information: Envoyer les informations Γ  l'utilisateur
759 label_send_information: Envoyer les informations Γ  l'utilisateur
759 label_year: AnnΓ©e
760 label_year: AnnΓ©e
760 label_month: Mois
761 label_month: Mois
761 label_week: Semaine
762 label_week: Semaine
762 label_date_from: Du
763 label_date_from: Du
763 label_date_to: Au
764 label_date_to: Au
764 label_language_based: BasΓ© sur la langue de l'utilisateur
765 label_language_based: BasΓ© sur la langue de l'utilisateur
765 label_sort_by: "Trier par %{value}"
766 label_sort_by: "Trier par %{value}"
766 label_send_test_email: Envoyer un email de test
767 label_send_test_email: Envoyer un email de test
767 label_feeds_access_key_created_on: "Clé d'accès RSS créée il y a %{value}"
768 label_feeds_access_key_created_on: "Clé d'accès RSS créée il y a %{value}"
768 label_module_plural: Modules
769 label_module_plural: Modules
769 label_added_time_by: "AjoutΓ© par %{author} il y a %{age}"
770 label_added_time_by: "AjoutΓ© par %{author} il y a %{age}"
770 label_updated_time_by: "Mis Γ  jour par %{author} il y a %{age}"
771 label_updated_time_by: "Mis Γ  jour par %{author} il y a %{age}"
771 label_updated_time: "Mis Γ  jour il y a %{value}"
772 label_updated_time: "Mis Γ  jour il y a %{value}"
772 label_jump_to_a_project: Aller Γ  un projet...
773 label_jump_to_a_project: Aller Γ  un projet...
773 label_file_plural: Fichiers
774 label_file_plural: Fichiers
774 label_changeset_plural: RΓ©visions
775 label_changeset_plural: RΓ©visions
775 label_default_columns: Colonnes par dΓ©faut
776 label_default_columns: Colonnes par dΓ©faut
776 label_no_change_option: (Pas de changement)
777 label_no_change_option: (Pas de changement)
777 label_bulk_edit_selected_issues: Modifier les demandes sΓ©lectionnΓ©es
778 label_bulk_edit_selected_issues: Modifier les demandes sΓ©lectionnΓ©es
778 label_theme: Thème
779 label_theme: Thème
779 label_default: DΓ©faut
780 label_default: DΓ©faut
780 label_search_titles_only: Uniquement dans les titres
781 label_search_titles_only: Uniquement dans les titres
781 label_user_mail_option_all: "Pour tous les Γ©vΓ©nements de tous mes projets"
782 label_user_mail_option_all: "Pour tous les Γ©vΓ©nements de tous mes projets"
782 label_user_mail_option_selected: "Pour tous les Γ©vΓ©nements des projets sΓ©lectionnΓ©s..."
783 label_user_mail_option_selected: "Pour tous les Γ©vΓ©nements des projets sΓ©lectionnΓ©s..."
783 label_user_mail_no_self_notified: "Je ne veux pas Γͺtre notifiΓ© des changements que j'effectue"
784 label_user_mail_no_self_notified: "Je ne veux pas Γͺtre notifiΓ© des changements que j'effectue"
784 label_registration_activation_by_email: activation du compte par email
785 label_registration_activation_by_email: activation du compte par email
785 label_registration_manual_activation: activation manuelle du compte
786 label_registration_manual_activation: activation manuelle du compte
786 label_registration_automatic_activation: activation automatique du compte
787 label_registration_automatic_activation: activation automatique du compte
787 label_display_per_page: "Par page : %{value}"
788 label_display_per_page: "Par page : %{value}"
788 label_age: Γ‚ge
789 label_age: Γ‚ge
789 label_change_properties: Changer les propriΓ©tΓ©s
790 label_change_properties: Changer les propriΓ©tΓ©s
790 label_general: GΓ©nΓ©ral
791 label_general: GΓ©nΓ©ral
791 label_more: Plus
792 label_more: Plus
792 label_scm: SCM
793 label_scm: SCM
793 label_plugins: Plugins
794 label_plugins: Plugins
794 label_ldap_authentication: Authentification LDAP
795 label_ldap_authentication: Authentification LDAP
795 label_downloads_abbr: D/L
796 label_downloads_abbr: D/L
796 label_optional_description: Description facultative
797 label_optional_description: Description facultative
797 label_add_another_file: Ajouter un autre fichier
798 label_add_another_file: Ajouter un autre fichier
798 label_preferences: PrΓ©fΓ©rences
799 label_preferences: PrΓ©fΓ©rences
799 label_chronological_order: Dans l'ordre chronologique
800 label_chronological_order: Dans l'ordre chronologique
800 label_reverse_chronological_order: Dans l'ordre chronologique inverse
801 label_reverse_chronological_order: Dans l'ordre chronologique inverse
801 label_planning: Planning
802 label_planning: Planning
802 label_incoming_emails: Emails entrants
803 label_incoming_emails: Emails entrants
803 label_generate_key: GΓ©nΓ©rer une clΓ©
804 label_generate_key: GΓ©nΓ©rer une clΓ©
804 label_issue_watchers: Observateurs
805 label_issue_watchers: Observateurs
805 label_example: Exemple
806 label_example: Exemple
806 label_display: Affichage
807 label_display: Affichage
807 label_sort: Tri
808 label_sort: Tri
808 label_ascending: Croissant
809 label_ascending: Croissant
809 label_descending: DΓ©croissant
810 label_descending: DΓ©croissant
810 label_date_from_to: Du %{start} au %{end}
811 label_date_from_to: Du %{start} au %{end}
811 label_wiki_content_added: Page wiki ajoutΓ©e
812 label_wiki_content_added: Page wiki ajoutΓ©e
812 label_wiki_content_updated: Page wiki mise Γ  jour
813 label_wiki_content_updated: Page wiki mise Γ  jour
813 label_group_plural: Groupes
814 label_group_plural: Groupes
814 label_group: Groupe
815 label_group: Groupe
815 label_group_new: Nouveau groupe
816 label_group_new: Nouveau groupe
816 label_time_entry_plural: Temps passΓ©
817 label_time_entry_plural: Temps passΓ©
817 label_version_sharing_none: Non partagΓ©
818 label_version_sharing_none: Non partagΓ©
818 label_version_sharing_descendants: Avec les sous-projets
819 label_version_sharing_descendants: Avec les sous-projets
819 label_version_sharing_hierarchy: Avec toute la hiΓ©rarchie
820 label_version_sharing_hierarchy: Avec toute la hiΓ©rarchie
820 label_version_sharing_tree: Avec tout l'arbre
821 label_version_sharing_tree: Avec tout l'arbre
821 label_version_sharing_system: Avec tous les projets
822 label_version_sharing_system: Avec tous les projets
822 label_copy_source: Source
823 label_copy_source: Source
823 label_copy_target: Cible
824 label_copy_target: Cible
824 label_copy_same_as_target: Comme la cible
825 label_copy_same_as_target: Comme la cible
825 label_update_issue_done_ratios: Mettre Γ  jour l'avancement des demandes
826 label_update_issue_done_ratios: Mettre Γ  jour l'avancement des demandes
826 label_display_used_statuses_only: N'afficher que les statuts utilisΓ©s dans ce tracker
827 label_display_used_statuses_only: N'afficher que les statuts utilisΓ©s dans ce tracker
827 label_api_access_key: Clé d'accès API
828 label_api_access_key: Clé d'accès API
828 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
829 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
829 label_feeds_access_key: Clé d'accès RSS
830 label_feeds_access_key: Clé d'accès RSS
830 label_missing_api_access_key: Clé d'accès API manquante
831 label_missing_api_access_key: Clé d'accès API manquante
831 label_missing_feeds_access_key: Clé d'accès RSS manquante
832 label_missing_feeds_access_key: Clé d'accès RSS manquante
832 label_close_versions: Fermer les versions terminΓ©es
833 label_close_versions: Fermer les versions terminΓ©es
833 label_revision_id: RΓ©vision %{value}
834 label_revision_id: RΓ©vision %{value}
834 label_profile: Profil
835 label_profile: Profil
835 label_subtask_plural: Sous-tΓ’ches
836 label_subtask_plural: Sous-tΓ’ches
836 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
837 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
837 label_principal_search: "Rechercher un utilisateur ou un groupe :"
838 label_principal_search: "Rechercher un utilisateur ou un groupe :"
838 label_user_search: "Rechercher un utilisateur :"
839 label_user_search: "Rechercher un utilisateur :"
839 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
840 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
840 label_additional_workflow_transitions_for_assignee: Autorisations supplΓ©mentaires lorsque la demande est assignΓ©e Γ  l'utilisateur
841 label_additional_workflow_transitions_for_assignee: Autorisations supplΓ©mentaires lorsque la demande est assignΓ©e Γ  l'utilisateur
841 label_issues_visibility_all: Toutes les demandes
842 label_issues_visibility_all: Toutes les demandes
842 label_issues_visibility_public: Toutes les demandes non privΓ©es
843 label_issues_visibility_public: Toutes les demandes non privΓ©es
843 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
844 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
844 label_export_options: Options d'exportation %{export_format}
845 label_export_options: Options d'exportation %{export_format}
845 label_copy_attachments: Copier les fichiers
846 label_copy_attachments: Copier les fichiers
846 label_copy_subtasks: Copier les sous-tΓ’ches
847 label_copy_subtasks: Copier les sous-tΓ’ches
847 label_item_position: "%{position} sur %{count}"
848 label_item_position: "%{position} sur %{count}"
848 label_completed_versions: Versions passΓ©es
849 label_completed_versions: Versions passΓ©es
849 label_session_expiration: Expiration des sessions
850 label_session_expiration: Expiration des sessions
850 label_show_closed_projects: Voir les projets fermΓ©s
851 label_show_closed_projects: Voir les projets fermΓ©s
851 label_status_transitions: Changements de statut
852 label_status_transitions: Changements de statut
852 label_fields_permissions: Permissions sur les champs
853 label_fields_permissions: Permissions sur les champs
853 label_readonly: Lecture
854 label_readonly: Lecture
854 label_required: Obligatoire
855 label_required: Obligatoire
855 label_attribute_of_project: "%{name} du projet"
856 label_attribute_of_project: "%{name} du projet"
856 label_attribute_of_author: "%{name} de l'auteur"
857 label_attribute_of_author: "%{name} de l'auteur"
857 label_attribute_of_assigned_to: "%{name} de l'assignΓ©"
858 label_attribute_of_assigned_to: "%{name} de l'assignΓ©"
858 label_attribute_of_fixed_version: "%{name} de la version cible"
859 label_attribute_of_fixed_version: "%{name} de la version cible"
859
860
860 button_login: Connexion
861 button_login: Connexion
861 button_submit: Soumettre
862 button_submit: Soumettre
862 button_save: Sauvegarder
863 button_save: Sauvegarder
863 button_check_all: Tout cocher
864 button_check_all: Tout cocher
864 button_uncheck_all: Tout dΓ©cocher
865 button_uncheck_all: Tout dΓ©cocher
865 button_collapse_all: Plier tout
866 button_collapse_all: Plier tout
866 button_expand_all: DΓ©plier tout
867 button_expand_all: DΓ©plier tout
867 button_delete: Supprimer
868 button_delete: Supprimer
868 button_create: CrΓ©er
869 button_create: CrΓ©er
869 button_create_and_continue: CrΓ©er et continuer
870 button_create_and_continue: CrΓ©er et continuer
870 button_test: Tester
871 button_test: Tester
871 button_edit: Modifier
872 button_edit: Modifier
872 button_add: Ajouter
873 button_add: Ajouter
873 button_change: Changer
874 button_change: Changer
874 button_apply: Appliquer
875 button_apply: Appliquer
875 button_clear: Effacer
876 button_clear: Effacer
876 button_lock: Verrouiller
877 button_lock: Verrouiller
877 button_unlock: DΓ©verrouiller
878 button_unlock: DΓ©verrouiller
878 button_download: TΓ©lΓ©charger
879 button_download: TΓ©lΓ©charger
879 button_list: Lister
880 button_list: Lister
880 button_view: Voir
881 button_view: Voir
881 button_move: DΓ©placer
882 button_move: DΓ©placer
882 button_move_and_follow: DΓ©placer et suivre
883 button_move_and_follow: DΓ©placer et suivre
883 button_back: Retour
884 button_back: Retour
884 button_cancel: Annuler
885 button_cancel: Annuler
885 button_activate: Activer
886 button_activate: Activer
886 button_sort: Trier
887 button_sort: Trier
887 button_log_time: Saisir temps
888 button_log_time: Saisir temps
888 button_rollback: Revenir Γ  cette version
889 button_rollback: Revenir Γ  cette version
889 button_watch: Surveiller
890 button_watch: Surveiller
890 button_unwatch: Ne plus surveiller
891 button_unwatch: Ne plus surveiller
891 button_reply: RΓ©pondre
892 button_reply: RΓ©pondre
892 button_archive: Archiver
893 button_archive: Archiver
893 button_unarchive: DΓ©sarchiver
894 button_unarchive: DΓ©sarchiver
894 button_reset: RΓ©initialiser
895 button_reset: RΓ©initialiser
895 button_rename: Renommer
896 button_rename: Renommer
896 button_change_password: Changer de mot de passe
897 button_change_password: Changer de mot de passe
897 button_copy: Copier
898 button_copy: Copier
898 button_copy_and_follow: Copier et suivre
899 button_copy_and_follow: Copier et suivre
899 button_annotate: Annoter
900 button_annotate: Annoter
900 button_update: Mettre Γ  jour
901 button_update: Mettre Γ  jour
901 button_configure: Configurer
902 button_configure: Configurer
902 button_quote: Citer
903 button_quote: Citer
903 button_duplicate: Dupliquer
904 button_duplicate: Dupliquer
904 button_show: Afficher
905 button_show: Afficher
905 button_edit_section: Modifier cette section
906 button_edit_section: Modifier cette section
906 button_export: Exporter
907 button_export: Exporter
907 button_delete_my_account: Supprimer mon compte
908 button_delete_my_account: Supprimer mon compte
908 button_close: Fermer
909 button_close: Fermer
909 button_reopen: RΓ©ouvrir
910 button_reopen: RΓ©ouvrir
910
911
911 status_active: actif
912 status_active: actif
912 status_registered: enregistrΓ©
913 status_registered: enregistrΓ©
913 status_locked: verrouillΓ©
914 status_locked: verrouillΓ©
914
915
915 project_status_active: actif
916 project_status_active: actif
916 project_status_closed: fermΓ©
917 project_status_closed: fermΓ©
917 project_status_archived: archivΓ©
918 project_status_archived: archivΓ©
918
919
919 version_status_open: ouvert
920 version_status_open: ouvert
920 version_status_locked: verrouillΓ©
921 version_status_locked: verrouillΓ©
921 version_status_closed: fermΓ©
922 version_status_closed: fermΓ©
922
923
923 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e
924 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e
924 text_regexp_info: ex. ^[A-Z0-9]+$
925 text_regexp_info: ex. ^[A-Z0-9]+$
925 text_min_max_length_info: 0 pour aucune restriction
926 text_min_max_length_info: 0 pour aucune restriction
926 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
927 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
927 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront Γ©galement supprimΓ©s."
928 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront Γ©galement supprimΓ©s."
928 text_workflow_edit: SΓ©lectionner un tracker et un rΓ΄le pour Γ©diter le workflow
929 text_workflow_edit: SΓ©lectionner un tracker et un rΓ΄le pour Γ©diter le workflow
929 text_are_you_sure: Êtes-vous sûr ?
930 text_are_you_sure: Êtes-vous sûr ?
930 text_tip_issue_begin_day: tΓ’che commenΓ§ant ce jour
931 text_tip_issue_begin_day: tΓ’che commenΓ§ant ce jour
931 text_tip_issue_end_day: tΓ’che finissant ce jour
932 text_tip_issue_end_day: tΓ’che finissant ce jour
932 text_tip_issue_begin_end_day: tΓ’che commenΓ§ant et finissant ce jour
933 text_tip_issue_begin_end_day: tΓ’che commenΓ§ant et finissant ce jour
933 text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et underscore sont autorisΓ©s.<br />Un fois sauvegardΓ©, l''identifiant ne pourra plus Γͺtre modifiΓ©.'
934 text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et underscore sont autorisΓ©s.<br />Un fois sauvegardΓ©, l''identifiant ne pourra plus Γͺtre modifiΓ©.'
934 text_caracters_maximum: "%{count} caractères maximum."
935 text_caracters_maximum: "%{count} caractères maximum."
935 text_caracters_minimum: "%{count} caractères minimum."
936 text_caracters_minimum: "%{count} caractères minimum."
936 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
937 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
937 text_tracker_no_workflow: Aucun worflow n'est dΓ©fini pour ce tracker
938 text_tracker_no_workflow: Aucun worflow n'est dΓ©fini pour ce tracker
938 text_unallowed_characters: Caractères non autorisés
939 text_unallowed_characters: Caractères non autorisés
939 text_comma_separated: Plusieurs valeurs possibles (sΓ©parΓ©es par des virgules).
940 text_comma_separated: Plusieurs valeurs possibles (sΓ©parΓ©es par des virgules).
940 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
941 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
941 text_issues_ref_in_commit_messages: RΓ©fΓ©rencement et rΓ©solution des demandes dans les commentaires de commits
942 text_issues_ref_in_commit_messages: RΓ©fΓ©rencement et rΓ©solution des demandes dans les commentaires de commits
942 text_issue_added: "La demande %{id} a Γ©tΓ© soumise par %{author}."
943 text_issue_added: "La demande %{id} a Γ©tΓ© soumise par %{author}."
943 text_issue_updated: "La demande %{id} a Γ©tΓ© mise Γ  jour par %{author}."
944 text_issue_updated: "La demande %{id} a Γ©tΓ© mise Γ  jour par %{author}."
944 text_wiki_destroy_confirmation: Etes-vous sΓ»r de vouloir supprimer ce wiki et tout son contenu ?
945 text_wiki_destroy_confirmation: Etes-vous sΓ»r de vouloir supprimer ce wiki et tout son contenu ?
945 text_issue_category_destroy_question: "%{count} demandes sont affectΓ©es Γ  cette catΓ©gorie. Que voulez-vous faire ?"
946 text_issue_category_destroy_question: "%{count} demandes sont affectΓ©es Γ  cette catΓ©gorie. Que voulez-vous faire ?"
946 text_issue_category_destroy_assignments: N'affecter les demandes Γ  aucune autre catΓ©gorie
947 text_issue_category_destroy_assignments: N'affecter les demandes Γ  aucune autre catΓ©gorie
947 text_issue_category_reassign_to: RΓ©affecter les demandes Γ  cette catΓ©gorie
948 text_issue_category_reassign_to: RΓ©affecter les demandes Γ  cette catΓ©gorie
948 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)."
949 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)."
949 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Γ©."
950 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Γ©."
950 text_load_default_configuration: Charger le paramΓ©trage par dΓ©faut
951 text_load_default_configuration: Charger le paramΓ©trage par dΓ©faut
951 text_status_changed_by_changeset: "AppliquΓ© par commit %{value}."
952 text_status_changed_by_changeset: "AppliquΓ© par commit %{value}."
952 text_time_logged_by_changeset: "AppliquΓ© par commit %{value}"
953 text_time_logged_by_changeset: "AppliquΓ© par commit %{value}"
953 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
954 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
954 text_issues_destroy_descendants_confirmation: "Cela entrainera Γ©galement la suppression de %{count} sous-tΓ’che(s)."
955 text_issues_destroy_descendants_confirmation: "Cela entrainera Γ©galement la suppression de %{count} sous-tΓ’che(s)."
955 text_select_project_modules: 'SΓ©lectionner les modules Γ  activer pour ce projet :'
956 text_select_project_modules: 'SΓ©lectionner les modules Γ  activer pour ce projet :'
956 text_default_administrator_account_changed: Compte administrateur par dΓ©faut changΓ©
957 text_default_administrator_account_changed: Compte administrateur par dΓ©faut changΓ©
957 text_file_repository_writable: RΓ©pertoire de stockage des fichiers accessible en Γ©criture
958 text_file_repository_writable: RΓ©pertoire de stockage des fichiers accessible en Γ©criture
958 text_plugin_assets_writable: RΓ©pertoire public des plugins accessible en Γ©criture
959 text_plugin_assets_writable: RΓ©pertoire public des plugins accessible en Γ©criture
959 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
960 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
960 text_destroy_time_entries_question: "%{hours} heures ont Γ©tΓ© enregistrΓ©es sur les demandes Γ  supprimer. Que voulez-vous faire ?"
961 text_destroy_time_entries_question: "%{hours} heures ont Γ©tΓ© enregistrΓ©es sur les demandes Γ  supprimer. Que voulez-vous faire ?"
961 text_destroy_time_entries: Supprimer les heures
962 text_destroy_time_entries: Supprimer les heures
962 text_assign_time_entries_to_project: Reporter les heures sur le projet
963 text_assign_time_entries_to_project: Reporter les heures sur le projet
963 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
964 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
964 text_user_wrote: "%{value} a Γ©crit :"
965 text_user_wrote: "%{value} a Γ©crit :"
965 text_enumeration_destroy_question: "Cette valeur est affectΓ©e Γ  %{count} objets."
966 text_enumeration_destroy_question: "Cette valeur est affectΓ©e Γ  %{count} objets."
966 text_enumeration_category_reassign_to: 'RΓ©affecter les objets Γ  cette valeur:'
967 text_enumeration_category_reassign_to: 'RΓ©affecter les objets Γ  cette valeur:'
967 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."
968 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."
968 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."
969 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."
969 text_diff_truncated: '... Ce diffΓ©rentiel a Γ©tΓ© tronquΓ© car il excΓ¨de la taille maximale pouvant Γͺtre affichΓ©e.'
970 text_diff_truncated: '... Ce diffΓ©rentiel a Γ©tΓ© tronquΓ© car il excΓ¨de la taille maximale pouvant Γͺtre affichΓ©e.'
970 text_custom_field_possible_values_info: 'Une ligne par valeur'
971 text_custom_field_possible_values_info: 'Une ligne par valeur'
971 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
972 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
972 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
973 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
973 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
974 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
974 text_wiki_page_reassign_children: "RΓ©affecter les sous-pages Γ  cette page"
975 text_wiki_page_reassign_children: "RΓ©affecter les sous-pages Γ  cette page"
975 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 ?"
976 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 ?"
976 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardΓ© qui sera perdu si vous quittez la page."
977 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardΓ© qui sera perdu si vous quittez la page."
977 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)"
978 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)"
978 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
979 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
979 text_issue_conflict_resolution_cancel: "Annuler ma mise Γ  jour et rΓ©afficher %{link}"
980 text_issue_conflict_resolution_cancel: "Annuler ma mise Γ  jour et rΓ©afficher %{link}"
980 text_account_destroy_confirmation: "Êtes-vous sûr de vouloir continuer ?\nVotre compte sera définitivement supprimé, sans aucune possibilité de le réactiver."
981 text_account_destroy_confirmation: "Êtes-vous sûr de vouloir continuer ?\nVotre compte sera définitivement supprimé, sans aucune possibilité de le réactiver."
981 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."
982 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."
982 text_project_closed: Ce projet est fermΓ© et accessible en lecture seule.
983 text_project_closed: Ce projet est fermΓ© et accessible en lecture seule.
983
984
984 default_role_manager: "Manager "
985 default_role_manager: "Manager "
985 default_role_developer: "DΓ©veloppeur "
986 default_role_developer: "DΓ©veloppeur "
986 default_role_reporter: "Rapporteur "
987 default_role_reporter: "Rapporteur "
987 default_tracker_bug: Anomalie
988 default_tracker_bug: Anomalie
988 default_tracker_feature: Evolution
989 default_tracker_feature: Evolution
989 default_tracker_support: Assistance
990 default_tracker_support: Assistance
990 default_issue_status_new: Nouveau
991 default_issue_status_new: Nouveau
991 default_issue_status_in_progress: En cours
992 default_issue_status_in_progress: En cours
992 default_issue_status_resolved: RΓ©solu
993 default_issue_status_resolved: RΓ©solu
993 default_issue_status_feedback: Commentaire
994 default_issue_status_feedback: Commentaire
994 default_issue_status_closed: FermΓ©
995 default_issue_status_closed: FermΓ©
995 default_issue_status_rejected: RejetΓ©
996 default_issue_status_rejected: RejetΓ©
996 default_doc_category_user: Documentation utilisateur
997 default_doc_category_user: Documentation utilisateur
997 default_doc_category_tech: Documentation technique
998 default_doc_category_tech: Documentation technique
998 default_priority_low: Bas
999 default_priority_low: Bas
999 default_priority_normal: Normal
1000 default_priority_normal: Normal
1000 default_priority_high: Haut
1001 default_priority_high: Haut
1001 default_priority_urgent: Urgent
1002 default_priority_urgent: Urgent
1002 default_priority_immediate: ImmΓ©diat
1003 default_priority_immediate: ImmΓ©diat
1003 default_activity_design: Conception
1004 default_activity_design: Conception
1004 default_activity_development: DΓ©veloppement
1005 default_activity_development: DΓ©veloppement
1005
1006
1006 enumeration_issue_priorities: PrioritΓ©s des demandes
1007 enumeration_issue_priorities: PrioritΓ©s des demandes
1007 enumeration_doc_categories: CatΓ©gories des documents
1008 enumeration_doc_categories: CatΓ©gories des documents
1008 enumeration_activities: ActivitΓ©s (suivi du temps)
1009 enumeration_activities: ActivitΓ©s (suivi du temps)
1009 label_greater_or_equal: ">="
1010 label_greater_or_equal: ">="
1010 label_less_or_equal: "<="
1011 label_less_or_equal: "<="
1011 label_between: entre
1012 label_between: entre
1012 label_view_all_revisions: Voir toutes les rΓ©visions
1013 label_view_all_revisions: Voir toutes les rΓ©visions
1013 label_tag: Tag
1014 label_tag: Tag
1014 label_branch: Branche
1015 label_branch: Branche
1015 error_no_tracker_in_project: "Aucun tracker n'est associΓ© Γ  ce projet. VΓ©rifier la configuration du projet."
1016 error_no_tracker_in_project: "Aucun tracker n'est associΓ© Γ  ce projet. VΓ©rifier la configuration du projet."
1016 error_no_default_issue_status: "Aucun statut de demande n'est dΓ©fini par dΓ©faut. VΓ©rifier votre configuration (Administration -> Statuts de demandes)."
1017 error_no_default_issue_status: "Aucun statut de demande n'est dΓ©fini par dΓ©faut. VΓ©rifier votre configuration (Administration -> Statuts de demandes)."
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 enumeration_system_activity: Activité système
1023 enumeration_system_activity: Activité système
1023 label_board_sticky: Sticky
1024 label_board_sticky: Sticky
1024 label_board_locked: VerrouillΓ©
1025 label_board_locked: VerrouillΓ©
1025 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
1026 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
1026 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisΓ©
1027 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisΓ©
1027 error_unable_to_connect: Connexion impossible (%{value})
1028 error_unable_to_connect: Connexion impossible (%{value})
1028 error_can_not_remove_role: Ce rΓ΄le est utilisΓ© et ne peut pas Γͺtre supprimΓ©.
1029 error_can_not_remove_role: Ce rΓ΄le est utilisΓ© et ne peut pas Γͺtre supprimΓ©.
1029 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas Γͺtre supprimΓ©.
1030 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas Γͺtre supprimΓ©.
1030 field_principal: Principal
1031 field_principal: Principal
1031 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
1032 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
1032 text_zoom_out: Zoom arrière
1033 text_zoom_out: Zoom arrière
1033 text_zoom_in: Zoom avant
1034 text_zoom_in: Zoom avant
1034 notice_unable_delete_time_entry: Impossible de supprimer le temps passΓ©.
1035 notice_unable_delete_time_entry: Impossible de supprimer le temps passΓ©.
1035 label_overall_spent_time: Temps passΓ© global
1036 label_overall_spent_time: Temps passΓ© global
1036 field_time_entries: Temps passΓ©
1037 field_time_entries: Temps passΓ©
1037 project_module_gantt: Gantt
1038 project_module_gantt: Gantt
1038 project_module_calendar: Calendrier
1039 project_module_calendar: Calendrier
1039 button_edit_associated_wikipage: "Modifier la page wiki associΓ©e: %{page_title}"
1040 button_edit_associated_wikipage: "Modifier la page wiki associΓ©e: %{page_title}"
1040 text_are_you_sure_with_children: Supprimer la demande et toutes ses sous-demandes ?
1041 text_are_you_sure_with_children: Supprimer la demande et toutes ses sous-demandes ?
1041 field_text: Champ texte
1042 field_text: Champ texte
1042 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
1043 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
1043 setting_default_notification_option: Option de notification par dΓ©faut
1044 setting_default_notification_option: Option de notification par dΓ©faut
1044 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
1045 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
1045 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assignΓ©
1046 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assignΓ©
1046 label_user_mail_option_none: Aucune notification
1047 label_user_mail_option_none: Aucune notification
1047 field_member_of_group: Groupe de l'assignΓ©
1048 field_member_of_group: Groupe de l'assignΓ©
1048 field_assigned_to_role: RΓ΄le de l'assignΓ©
1049 field_assigned_to_role: RΓ΄le de l'assignΓ©
1049 setting_emails_header: En-tΓͺte des emails
1050 setting_emails_header: En-tΓͺte des emails
1050 label_bulk_edit_selected_time_entries: Modifier les temps passΓ©s sΓ©lectionnΓ©s
1051 label_bulk_edit_selected_time_entries: Modifier les temps passΓ©s sΓ©lectionnΓ©s
1051 text_time_entries_destroy_confirmation: "Etes-vous sΓ»r de vouloir supprimer les temps passΓ©s sΓ©lectionnΓ©s ?"
1052 text_time_entries_destroy_confirmation: "Etes-vous sΓ»r de vouloir supprimer les temps passΓ©s sΓ©lectionnΓ©s ?"
1052 field_scm_path_encoding: Encodage des chemins
1053 field_scm_path_encoding: Encodage des chemins
1053 text_scm_path_encoding_note: "DΓ©faut : UTF-8"
1054 text_scm_path_encoding_note: "DΓ©faut : UTF-8"
1054 field_path_to_repository: Chemin du dΓ©pΓ΄t
1055 field_path_to_repository: Chemin du dΓ©pΓ΄t
1055 field_root_directory: RΓ©pertoire racine
1056 field_root_directory: RΓ©pertoire racine
1056 field_cvs_module: Module
1057 field_cvs_module: Module
1057 field_cvsroot: CVSROOT
1058 field_cvsroot: CVSROOT
1058 text_mercurial_repository_note: "DΓ©pΓ΄t local (exemples : /hgrepo, c:\\hgrepo)"
1059 text_mercurial_repository_note: "DΓ©pΓ΄t local (exemples : /hgrepo, c:\\hgrepo)"
1059 text_scm_command: Commande
1060 text_scm_command: Commande
1060 text_scm_command_version: Version
1061 text_scm_command_version: Version
1061 label_git_report_last_commit: Afficher le dernier commit des fichiers et rΓ©pertoires
1062 label_git_report_last_commit: Afficher le dernier commit des fichiers et rΓ©pertoires
1062 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1063 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1063 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1064 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1064 label_diff: diff
1065 label_diff: diff
1065 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1066 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1066 description_query_sort_criteria_direction: Ordre de tri
1067 description_query_sort_criteria_direction: Ordre de tri
1067 description_project_scope: Périmètre de recherche
1068 description_project_scope: Périmètre de recherche
1068 description_filter: Filtre
1069 description_filter: Filtre
1069 description_user_mail_notification: Option de notification
1070 description_user_mail_notification: Option de notification
1070 description_date_from: Date de dΓ©but
1071 description_date_from: Date de dΓ©but
1071 description_message_content: Contenu du message
1072 description_message_content: Contenu du message
1072 description_available_columns: Colonnes disponibles
1073 description_available_columns: Colonnes disponibles
1073 description_all_columns: Toutes les colonnes
1074 description_all_columns: Toutes les colonnes
1074 description_date_range_interval: Choisir une pΓ©riode
1075 description_date_range_interval: Choisir une pΓ©riode
1075 description_issue_category_reassign: Choisir une catΓ©gorie
1076 description_issue_category_reassign: Choisir une catΓ©gorie
1076 description_search: Champ de recherche
1077 description_search: Champ de recherche
1077 description_notes: Notes
1078 description_notes: Notes
1078 description_date_range_list: Choisir une pΓ©riode prΓ©dΓ©finie
1079 description_date_range_list: Choisir une pΓ©riode prΓ©dΓ©finie
1079 description_choose_project: Projets
1080 description_choose_project: Projets
1080 description_date_to: Date de fin
1081 description_date_to: Date de fin
1081 description_query_sort_criteria_attribute: Critère de tri
1082 description_query_sort_criteria_attribute: Critère de tri
1082 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1083 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1083 description_selected_columns: Colonnes sΓ©lectionnΓ©es
1084 description_selected_columns: Colonnes sΓ©lectionnΓ©es
1084 label_parent_revision: Parent
1085 label_parent_revision: Parent
1085 label_child_revision: Enfant
1086 label_child_revision: Enfant
1086 error_scm_annotate_big_text_file: Cette entrΓ©e ne peut pas Γͺtre annotΓ©e car elle excΓ¨de la taille maximale.
1087 error_scm_annotate_big_text_file: Cette entrΓ©e ne peut pas Γͺtre annotΓ©e car elle excΓ¨de la taille maximale.
1087 setting_repositories_encodings: Encodages des fichiers et des dΓ©pΓ΄ts
1088 setting_repositories_encodings: Encodages des fichiers et des dΓ©pΓ΄ts
1088 label_search_for_watchers: Rechercher des observateurs
1089 label_search_for_watchers: Rechercher des observateurs
1089 text_repository_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et underscore sont autorisΓ©s.<br />Un fois sauvegardΓ©, l''identifiant ne pourra plus Γͺtre modifiΓ©.'
1090 text_repository_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres, tirets et underscore sont autorisΓ©s.<br />Un fois sauvegardΓ©, l''identifiant ne pourra plus Γͺtre modifiΓ©.'
@@ -1,219 +1,222
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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
18
19 # DO NOT MODIFY THIS FILE !!!
19 # DO NOT MODIFY THIS FILE !!!
20 # Settings can be defined through the application in Admin -> Settings
20 # Settings can be defined through the application in Admin -> Settings
21
21
22 app_title:
22 app_title:
23 default: Redmine
23 default: Redmine
24 app_subtitle:
24 app_subtitle:
25 default: Project management
25 default: Project management
26 welcome_text:
26 welcome_text:
27 default:
27 default:
28 login_required:
28 login_required:
29 default: 0
29 default: 0
30 self_registration:
30 self_registration:
31 default: '2'
31 default: '2'
32 lost_password:
32 lost_password:
33 default: 1
33 default: 1
34 unsubscribe:
34 unsubscribe:
35 default: 1
35 default: 1
36 password_min_length:
36 password_min_length:
37 format: int
37 format: int
38 default: 4
38 default: 4
39 # Maximum lifetime of user sessions in minutes
39 # Maximum lifetime of user sessions in minutes
40 session_lifetime:
40 session_lifetime:
41 format: int
41 format: int
42 default: 0
42 default: 0
43 # User session timeout in minutes
43 # User session timeout in minutes
44 session_timeout:
44 session_timeout:
45 format: int
45 format: int
46 default: 0
46 default: 0
47 attachment_max_size:
47 attachment_max_size:
48 format: int
48 format: int
49 default: 5120
49 default: 5120
50 issues_export_limit:
50 issues_export_limit:
51 format: int
51 format: int
52 default: 500
52 default: 500
53 activity_days_default:
53 activity_days_default:
54 format: int
54 format: int
55 default: 30
55 default: 30
56 per_page_options:
56 per_page_options:
57 default: '25,50,100'
57 default: '25,50,100'
58 mail_from:
58 mail_from:
59 default: redmine@example.net
59 default: redmine@example.net
60 bcc_recipients:
60 bcc_recipients:
61 default: 1
61 default: 1
62 plain_text_mail:
62 plain_text_mail:
63 default: 0
63 default: 0
64 text_formatting:
64 text_formatting:
65 default: textile
65 default: textile
66 cache_formatted_text:
66 cache_formatted_text:
67 default: 0
67 default: 0
68 wiki_compression:
68 wiki_compression:
69 default: ""
69 default: ""
70 default_language:
70 default_language:
71 default: en
71 default: en
72 host_name:
72 host_name:
73 default: localhost:3000
73 default: localhost:3000
74 protocol:
74 protocol:
75 default: http
75 default: http
76 feeds_limit:
76 feeds_limit:
77 format: int
77 format: int
78 default: 15
78 default: 15
79 gantt_items_limit:
79 gantt_items_limit:
80 format: int
80 format: int
81 default: 500
81 default: 500
82 # Maximum size of files that can be displayed
82 # Maximum size of files that can be displayed
83 # inline through the file viewer (in KB)
83 # inline through the file viewer (in KB)
84 file_max_size_displayed:
84 file_max_size_displayed:
85 format: int
85 format: int
86 default: 512
86 default: 512
87 diff_max_lines_displayed:
87 diff_max_lines_displayed:
88 format: int
88 format: int
89 default: 1500
89 default: 1500
90 enabled_scm:
90 enabled_scm:
91 serialized: true
91 serialized: true
92 default:
92 default:
93 - Subversion
93 - Subversion
94 - Darcs
94 - Darcs
95 - Mercurial
95 - Mercurial
96 - Cvs
96 - Cvs
97 - Bazaar
97 - Bazaar
98 - Git
98 - Git
99 autofetch_changesets:
99 autofetch_changesets:
100 default: 1
100 default: 1
101 sys_api_enabled:
101 sys_api_enabled:
102 default: 0
102 default: 0
103 sys_api_key:
103 sys_api_key:
104 default: ''
104 default: ''
105 commit_cross_project_ref:
105 commit_cross_project_ref:
106 default: 0
106 default: 0
107 commit_ref_keywords:
107 commit_ref_keywords:
108 default: 'refs,references,IssueID'
108 default: 'refs,references,IssueID'
109 commit_fix_keywords:
109 commit_fix_keywords:
110 default: 'fixes,closes'
110 default: 'fixes,closes'
111 commit_fix_status_id:
111 commit_fix_status_id:
112 format: int
112 format: int
113 default: 0
113 default: 0
114 commit_fix_done_ratio:
114 commit_fix_done_ratio:
115 default: 100
115 default: 100
116 commit_logtime_enabled:
116 commit_logtime_enabled:
117 default: 0
117 default: 0
118 commit_logtime_activity_id:
118 commit_logtime_activity_id:
119 format: int
119 format: int
120 default: 0
120 default: 0
121 # autologin duration in days
121 # autologin duration in days
122 # 0 means autologin is disabled
122 # 0 means autologin is disabled
123 autologin:
123 autologin:
124 format: int
124 format: int
125 default: 0
125 default: 0
126 # date format
126 # date format
127 date_format:
127 date_format:
128 default: ''
128 default: ''
129 time_format:
129 time_format:
130 default: ''
130 default: ''
131 user_format:
131 user_format:
132 default: :firstname_lastname
132 default: :firstname_lastname
133 format: symbol
133 format: symbol
134 cross_project_issue_relations:
134 cross_project_issue_relations:
135 default: 0
135 default: 0
136 # Enables subtasks to be in other projects
137 cross_project_subtasks:
138 default: 'tree'
136 issue_group_assignment:
139 issue_group_assignment:
137 default: 0
140 default: 0
138 default_issue_start_date_to_creation_date:
141 default_issue_start_date_to_creation_date:
139 default: 1
142 default: 1
140 notified_events:
143 notified_events:
141 serialized: true
144 serialized: true
142 default:
145 default:
143 - issue_added
146 - issue_added
144 - issue_updated
147 - issue_updated
145 mail_handler_body_delimiters:
148 mail_handler_body_delimiters:
146 default: ''
149 default: ''
147 mail_handler_api_enabled:
150 mail_handler_api_enabled:
148 default: 0
151 default: 0
149 mail_handler_api_key:
152 mail_handler_api_key:
150 default:
153 default:
151 issue_list_default_columns:
154 issue_list_default_columns:
152 serialized: true
155 serialized: true
153 default:
156 default:
154 - tracker
157 - tracker
155 - status
158 - status
156 - priority
159 - priority
157 - subject
160 - subject
158 - assigned_to
161 - assigned_to
159 - updated_on
162 - updated_on
160 display_subprojects_issues:
163 display_subprojects_issues:
161 default: 1
164 default: 1
162 issue_done_ratio:
165 issue_done_ratio:
163 default: 'issue_field'
166 default: 'issue_field'
164 default_projects_public:
167 default_projects_public:
165 default: 1
168 default: 1
166 default_projects_modules:
169 default_projects_modules:
167 serialized: true
170 serialized: true
168 default:
171 default:
169 - issue_tracking
172 - issue_tracking
170 - time_tracking
173 - time_tracking
171 - news
174 - news
172 - documents
175 - documents
173 - files
176 - files
174 - wiki
177 - wiki
175 - repository
178 - repository
176 - boards
179 - boards
177 - calendar
180 - calendar
178 - gantt
181 - gantt
179 # Role given to a non-admin user who creates a project
182 # Role given to a non-admin user who creates a project
180 new_project_user_role_id:
183 new_project_user_role_id:
181 format: int
184 format: int
182 default: ''
185 default: ''
183 sequential_project_identifiers:
186 sequential_project_identifiers:
184 default: 0
187 default: 0
185 # encodings used to convert repository files content to UTF-8
188 # encodings used to convert repository files content to UTF-8
186 # multiple values accepted, comma separated
189 # multiple values accepted, comma separated
187 repositories_encodings:
190 repositories_encodings:
188 default: ''
191 default: ''
189 # encoding used to convert commit logs to UTF-8
192 # encoding used to convert commit logs to UTF-8
190 commit_logs_encoding:
193 commit_logs_encoding:
191 default: 'UTF-8'
194 default: 'UTF-8'
192 repository_log_display_limit:
195 repository_log_display_limit:
193 format: int
196 format: int
194 default: 100
197 default: 100
195 ui_theme:
198 ui_theme:
196 default: ''
199 default: ''
197 emails_footer:
200 emails_footer:
198 default: |-
201 default: |-
199 You have received this notification because you have either subscribed to it, or are involved in it.
202 You have received this notification because you have either subscribed to it, or are involved in it.
200 To change your notification preferences, please click here: http://hostname/my/account
203 To change your notification preferences, please click here: http://hostname/my/account
201 gravatar_enabled:
204 gravatar_enabled:
202 default: 0
205 default: 0
203 openid:
206 openid:
204 default: 0
207 default: 0
205 gravatar_default:
208 gravatar_default:
206 default: ''
209 default: ''
207 start_of_week:
210 start_of_week:
208 default: ''
211 default: ''
209 rest_api_enabled:
212 rest_api_enabled:
210 default: 0
213 default: 0
211 default_notification_option:
214 default_notification_option:
212 default: 'only_my_events'
215 default: 'only_my_events'
213 emails_header:
216 emails_header:
214 default: ''
217 default: ''
215 thumbnails_enabled:
218 thumbnails_enabled:
216 default: 0
219 default: 0
217 thumbnails_size:
220 thumbnails_size:
218 format: int
221 format: int
219 default: 100
222 default: 100
@@ -1,44 +1,47
1 ---
1 ---
2 projects_trackers_001:
2 projects_trackers_001:
3 project_id: 4
3 project_id: 4
4 tracker_id: 3
4 tracker_id: 3
5 projects_trackers_002:
5 projects_trackers_002:
6 project_id: 1
6 project_id: 1
7 tracker_id: 1
7 tracker_id: 1
8 projects_trackers_003:
8 projects_trackers_003:
9 project_id: 5
9 project_id: 5
10 tracker_id: 1
10 tracker_id: 1
11 projects_trackers_004:
11 projects_trackers_004:
12 project_id: 1
12 project_id: 1
13 tracker_id: 2
13 tracker_id: 2
14 projects_trackers_005:
14 projects_trackers_005:
15 project_id: 5
15 project_id: 5
16 tracker_id: 2
16 tracker_id: 2
17 projects_trackers_006:
17 projects_trackers_006:
18 project_id: 5
18 project_id: 5
19 tracker_id: 3
19 tracker_id: 3
20 projects_trackers_007:
20 projects_trackers_007:
21 project_id: 2
21 project_id: 2
22 tracker_id: 1
22 tracker_id: 1
23 projects_trackers_008:
23 projects_trackers_008:
24 project_id: 2
24 project_id: 2
25 tracker_id: 2
25 tracker_id: 2
26 projects_trackers_009:
26 projects_trackers_009:
27 project_id: 2
27 project_id: 2
28 tracker_id: 3
28 tracker_id: 3
29 projects_trackers_010:
29 projects_trackers_010:
30 project_id: 3
30 project_id: 3
31 tracker_id: 2
31 tracker_id: 2
32 projects_trackers_011:
32 projects_trackers_011:
33 project_id: 3
33 project_id: 3
34 tracker_id: 3
34 tracker_id: 3
35 projects_trackers_012:
35 projects_trackers_012:
36 project_id: 4
36 project_id: 4
37 tracker_id: 1
37 tracker_id: 1
38 projects_trackers_013:
38 projects_trackers_013:
39 project_id: 4
39 project_id: 4
40 tracker_id: 2
40 tracker_id: 2
41 projects_trackers_014:
41 projects_trackers_014:
42 project_id: 1
42 project_id: 1
43 tracker_id: 3
43 tracker_id: 3
44 projects_trackers_015:
45 project_id: 6
46 tracker_id: 1
44 No newline at end of file
47
@@ -1,472 +1,480
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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 'shoulda'
18 #require 'shoulda'
19 ENV["RAILS_ENV"] = "test"
19 ENV["RAILS_ENV"] = "test"
20 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
20 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
21 require 'rails/test_help'
21 require 'rails/test_help'
22 require Rails.root.join('test', 'mocks', 'open_id_authentication_mock.rb').to_s
22 require Rails.root.join('test', 'mocks', 'open_id_authentication_mock.rb').to_s
23
23
24 require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
24 require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
25 include ObjectHelpers
25 include ObjectHelpers
26
26
27 class ActiveSupport::TestCase
27 class ActiveSupport::TestCase
28 include ActionDispatch::TestProcess
28 include ActionDispatch::TestProcess
29
29
30 # Transactional fixtures accelerate your tests by wrapping each test method
30 # Transactional fixtures accelerate your tests by wrapping each test method
31 # in a transaction that's rolled back on completion. This ensures that the
31 # in a transaction that's rolled back on completion. This ensures that the
32 # test database remains unchanged so your fixtures don't have to be reloaded
32 # test database remains unchanged so your fixtures don't have to be reloaded
33 # between every test method. Fewer database queries means faster tests.
33 # between every test method. Fewer database queries means faster tests.
34 #
34 #
35 # Read Mike Clark's excellent walkthrough at
35 # Read Mike Clark's excellent walkthrough at
36 # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
36 # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
37 #
37 #
38 # Every Active Record database supports transactions except MyISAM tables
38 # Every Active Record database supports transactions except MyISAM tables
39 # in MySQL. Turn off transactional fixtures in this case; however, if you
39 # in MySQL. Turn off transactional fixtures in this case; however, if you
40 # don't care one way or the other, switching from MyISAM to InnoDB tables
40 # don't care one way or the other, switching from MyISAM to InnoDB tables
41 # is recommended.
41 # is recommended.
42 self.use_transactional_fixtures = true
42 self.use_transactional_fixtures = true
43
43
44 # Instantiated fixtures are slow, but give you @david where otherwise you
44 # Instantiated fixtures are slow, but give you @david where otherwise you
45 # would need people(:david). If you don't want to migrate your existing
45 # would need people(:david). If you don't want to migrate your existing
46 # test cases which use the @david style and don't mind the speed hit (each
46 # test cases which use the @david style and don't mind the speed hit (each
47 # instantiated fixtures translates to a database query per test method),
47 # instantiated fixtures translates to a database query per test method),
48 # then set this back to true.
48 # then set this back to true.
49 self.use_instantiated_fixtures = false
49 self.use_instantiated_fixtures = false
50
50
51 # Add more helper methods to be used by all tests here...
51 # Add more helper methods to be used by all tests here...
52
52
53 def log_user(login, password)
53 def log_user(login, password)
54 User.anonymous
54 User.anonymous
55 get "/login"
55 get "/login"
56 assert_equal nil, session[:user_id]
56 assert_equal nil, session[:user_id]
57 assert_response :success
57 assert_response :success
58 assert_template "account/login"
58 assert_template "account/login"
59 post "/login", :username => login, :password => password
59 post "/login", :username => login, :password => password
60 assert_equal login, User.find(session[:user_id]).login
60 assert_equal login, User.find(session[:user_id]).login
61 end
61 end
62
62
63 def uploaded_test_file(name, mime)
63 def uploaded_test_file(name, mime)
64 fixture_file_upload("files/#{name}", mime, true)
64 fixture_file_upload("files/#{name}", mime, true)
65 end
65 end
66
66
67 def credentials(user, password=nil)
67 def credentials(user, password=nil)
68 {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
68 {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
69 end
69 end
70
70
71 # Mock out a file
71 # Mock out a file
72 def self.mock_file
72 def self.mock_file
73 file = 'a_file.png'
73 file = 'a_file.png'
74 file.stubs(:size).returns(32)
74 file.stubs(:size).returns(32)
75 file.stubs(:original_filename).returns('a_file.png')
75 file.stubs(:original_filename).returns('a_file.png')
76 file.stubs(:content_type).returns('image/png')
76 file.stubs(:content_type).returns('image/png')
77 file.stubs(:read).returns(false)
77 file.stubs(:read).returns(false)
78 file
78 file
79 end
79 end
80
80
81 def mock_file
81 def mock_file
82 self.class.mock_file
82 self.class.mock_file
83 end
83 end
84
84
85 def mock_file_with_options(options={})
85 def mock_file_with_options(options={})
86 file = ''
86 file = ''
87 file.stubs(:size).returns(32)
87 file.stubs(:size).returns(32)
88 original_filename = options[:original_filename] || nil
88 original_filename = options[:original_filename] || nil
89 file.stubs(:original_filename).returns(original_filename)
89 file.stubs(:original_filename).returns(original_filename)
90 content_type = options[:content_type] || nil
90 content_type = options[:content_type] || nil
91 file.stubs(:content_type).returns(content_type)
91 file.stubs(:content_type).returns(content_type)
92 file.stubs(:read).returns(false)
92 file.stubs(:read).returns(false)
93 file
93 file
94 end
94 end
95
95
96 # Use a temporary directory for attachment related tests
96 # Use a temporary directory for attachment related tests
97 def set_tmp_attachments_directory
97 def set_tmp_attachments_directory
98 Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test")
98 Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test")
99 unless File.directory?("#{Rails.root}/tmp/test/attachments")
99 unless File.directory?("#{Rails.root}/tmp/test/attachments")
100 Dir.mkdir "#{Rails.root}/tmp/test/attachments"
100 Dir.mkdir "#{Rails.root}/tmp/test/attachments"
101 end
101 end
102 Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
102 Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
103 end
103 end
104
104
105 def set_fixtures_attachments_directory
105 def set_fixtures_attachments_directory
106 Attachment.storage_path = "#{Rails.root}/test/fixtures/files"
106 Attachment.storage_path = "#{Rails.root}/test/fixtures/files"
107 end
107 end
108
108
109 def with_settings(options, &block)
109 def with_settings(options, &block)
110 saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].is_a?(Symbol) ? Setting[k] : Setting[k].dup; h}
110 saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].is_a?(Symbol) ? Setting[k] : Setting[k].dup; h}
111 options.each {|k, v| Setting[k] = v}
111 options.each {|k, v| Setting[k] = v}
112 yield
112 yield
113 ensure
113 ensure
114 saved_settings.each {|k, v| Setting[k] = v} if saved_settings
114 saved_settings.each {|k, v| Setting[k] = v} if saved_settings
115 end
115 end
116
116
117 def change_user_password(login, new_password)
117 def change_user_password(login, new_password)
118 user = User.first(:conditions => {:login => login})
118 user = User.first(:conditions => {:login => login})
119 user.password, user.password_confirmation = new_password, new_password
119 user.password, user.password_confirmation = new_password, new_password
120 user.save!
120 user.save!
121 end
121 end
122
122
123 def self.ldap_configured?
123 def self.ldap_configured?
124 @test_ldap = Net::LDAP.new(:host => '127.0.0.1', :port => 389)
124 @test_ldap = Net::LDAP.new(:host => '127.0.0.1', :port => 389)
125 return @test_ldap.bind
125 return @test_ldap.bind
126 rescue Exception => e
126 rescue Exception => e
127 # LDAP is not listening
127 # LDAP is not listening
128 return nil
128 return nil
129 end
129 end
130
130
131 def self.convert_installed?
131 def self.convert_installed?
132 Redmine::Thumbnail.convert_available?
132 Redmine::Thumbnail.convert_available?
133 end
133 end
134
134
135 # Returns the path to the test +vendor+ repository
135 # Returns the path to the test +vendor+ repository
136 def self.repository_path(vendor)
136 def self.repository_path(vendor)
137 Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
137 Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
138 end
138 end
139
139
140 # Returns the url of the subversion test repository
140 # Returns the url of the subversion test repository
141 def self.subversion_repository_url
141 def self.subversion_repository_url
142 path = repository_path('subversion')
142 path = repository_path('subversion')
143 path = '/' + path unless path.starts_with?('/')
143 path = '/' + path unless path.starts_with?('/')
144 "file://#{path}"
144 "file://#{path}"
145 end
145 end
146
146
147 # Returns true if the +vendor+ test repository is configured
147 # Returns true if the +vendor+ test repository is configured
148 def self.repository_configured?(vendor)
148 def self.repository_configured?(vendor)
149 File.directory?(repository_path(vendor))
149 File.directory?(repository_path(vendor))
150 end
150 end
151
151
152 def repository_path_hash(arr)
152 def repository_path_hash(arr)
153 hs = {}
153 hs = {}
154 hs[:path] = arr.join("/")
154 hs[:path] = arr.join("/")
155 hs[:param] = arr.join("/")
155 hs[:param] = arr.join("/")
156 hs
156 hs
157 end
157 end
158
158
159 def assert_save(object)
160 saved = object.save
161 message = "#{object.class} could not be saved"
162 errors = object.errors.full_messages.map {|m| "- #{m}"}
163 message << ":\n#{errors.join("\n")}" if errors.any?
164 assert_equal true, saved, message
165 end
166
159 def assert_error_tag(options={})
167 def assert_error_tag(options={})
160 assert_tag({:attributes => { :id => 'errorExplanation' }}.merge(options))
168 assert_tag({:attributes => { :id => 'errorExplanation' }}.merge(options))
161 end
169 end
162
170
163 def assert_include(expected, s, message=nil)
171 def assert_include(expected, s, message=nil)
164 assert s.include?(expected), (message || "\"#{expected}\" not found in \"#{s}\"")
172 assert s.include?(expected), (message || "\"#{expected}\" not found in \"#{s}\"")
165 end
173 end
166
174
167 def assert_not_include(expected, s)
175 def assert_not_include(expected, s)
168 assert !s.include?(expected), "\"#{expected}\" found in \"#{s}\""
176 assert !s.include?(expected), "\"#{expected}\" found in \"#{s}\""
169 end
177 end
170
178
171 def assert_mail_body_match(expected, mail)
179 def assert_mail_body_match(expected, mail)
172 if expected.is_a?(String)
180 if expected.is_a?(String)
173 assert_include expected, mail_body(mail)
181 assert_include expected, mail_body(mail)
174 else
182 else
175 assert_match expected, mail_body(mail)
183 assert_match expected, mail_body(mail)
176 end
184 end
177 end
185 end
178
186
179 def assert_mail_body_no_match(expected, mail)
187 def assert_mail_body_no_match(expected, mail)
180 if expected.is_a?(String)
188 if expected.is_a?(String)
181 assert_not_include expected, mail_body(mail)
189 assert_not_include expected, mail_body(mail)
182 else
190 else
183 assert_no_match expected, mail_body(mail)
191 assert_no_match expected, mail_body(mail)
184 end
192 end
185 end
193 end
186
194
187 def mail_body(mail)
195 def mail_body(mail)
188 mail.parts.first.body.encoded
196 mail.parts.first.body.encoded
189 end
197 end
190
198
191 # Shoulda macros
199 # Shoulda macros
192 def self.should_render_404
200 def self.should_render_404
193 should_respond_with :not_found
201 should_respond_with :not_found
194 should_render_template 'common/error'
202 should_render_template 'common/error'
195 end
203 end
196
204
197 def self.should_have_before_filter(expected_method, options = {})
205 def self.should_have_before_filter(expected_method, options = {})
198 should_have_filter('before', expected_method, options)
206 should_have_filter('before', expected_method, options)
199 end
207 end
200
208
201 def self.should_have_after_filter(expected_method, options = {})
209 def self.should_have_after_filter(expected_method, options = {})
202 should_have_filter('after', expected_method, options)
210 should_have_filter('after', expected_method, options)
203 end
211 end
204
212
205 def self.should_have_filter(filter_type, expected_method, options)
213 def self.should_have_filter(filter_type, expected_method, options)
206 description = "have #{filter_type}_filter :#{expected_method}"
214 description = "have #{filter_type}_filter :#{expected_method}"
207 description << " with #{options.inspect}" unless options.empty?
215 description << " with #{options.inspect}" unless options.empty?
208
216
209 should description do
217 should description do
210 klass = "action_controller/filters/#{filter_type}_filter".classify.constantize
218 klass = "action_controller/filters/#{filter_type}_filter".classify.constantize
211 expected = klass.new(:filter, expected_method.to_sym, options)
219 expected = klass.new(:filter, expected_method.to_sym, options)
212 assert_equal 1, @controller.class.filter_chain.select { |filter|
220 assert_equal 1, @controller.class.filter_chain.select { |filter|
213 filter.method == expected.method && filter.kind == expected.kind &&
221 filter.method == expected.method && filter.kind == expected.kind &&
214 filter.options == expected.options && filter.class == expected.class
222 filter.options == expected.options && filter.class == expected.class
215 }.size
223 }.size
216 end
224 end
217 end
225 end
218
226
219 # Test that a request allows the three types of API authentication
227 # Test that a request allows the three types of API authentication
220 #
228 #
221 # * HTTP Basic with username and password
229 # * HTTP Basic with username and password
222 # * HTTP Basic with an api key for the username
230 # * HTTP Basic with an api key for the username
223 # * Key based with the key=X parameter
231 # * Key based with the key=X parameter
224 #
232 #
225 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
233 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
226 # @param [String] url the request url
234 # @param [String] url the request url
227 # @param [optional, Hash] parameters additional request parameters
235 # @param [optional, Hash] parameters additional request parameters
228 # @param [optional, Hash] options additional options
236 # @param [optional, Hash] options additional options
229 # @option options [Symbol] :success_code Successful response code (:success)
237 # @option options [Symbol] :success_code Successful response code (:success)
230 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
238 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
231 def self.should_allow_api_authentication(http_method, url, parameters={}, options={})
239 def self.should_allow_api_authentication(http_method, url, parameters={}, options={})
232 should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options)
240 should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options)
233 should_allow_http_basic_auth_with_key(http_method, url, parameters, options)
241 should_allow_http_basic_auth_with_key(http_method, url, parameters, options)
234 should_allow_key_based_auth(http_method, url, parameters, options)
242 should_allow_key_based_auth(http_method, url, parameters, options)
235 end
243 end
236
244
237 # Test that a request allows the username and password for HTTP BASIC
245 # Test that a request allows the username and password for HTTP BASIC
238 #
246 #
239 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
247 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
240 # @param [String] url the request url
248 # @param [String] url the request url
241 # @param [optional, Hash] parameters additional request parameters
249 # @param [optional, Hash] parameters additional request parameters
242 # @param [optional, Hash] options additional options
250 # @param [optional, Hash] options additional options
243 # @option options [Symbol] :success_code Successful response code (:success)
251 # @option options [Symbol] :success_code Successful response code (:success)
244 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
252 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
245 def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={})
253 def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={})
246 success_code = options[:success_code] || :success
254 success_code = options[:success_code] || :success
247 failure_code = options[:failure_code] || :unauthorized
255 failure_code = options[:failure_code] || :unauthorized
248
256
249 context "should allow http basic auth using a username and password for #{http_method} #{url}" do
257 context "should allow http basic auth using a username and password for #{http_method} #{url}" do
250 context "with a valid HTTP authentication" do
258 context "with a valid HTTP authentication" do
251 setup do
259 setup do
252 @user = User.generate! do |user|
260 @user = User.generate! do |user|
253 user.admin = true
261 user.admin = true
254 user.password = 'my_password'
262 user.password = 'my_password'
255 end
263 end
256 send(http_method, url, parameters, credentials(@user.login, 'my_password'))
264 send(http_method, url, parameters, credentials(@user.login, 'my_password'))
257 end
265 end
258
266
259 should_respond_with success_code
267 should_respond_with success_code
260 should_respond_with_content_type_based_on_url(url)
268 should_respond_with_content_type_based_on_url(url)
261 should "login as the user" do
269 should "login as the user" do
262 assert_equal @user, User.current
270 assert_equal @user, User.current
263 end
271 end
264 end
272 end
265
273
266 context "with an invalid HTTP authentication" do
274 context "with an invalid HTTP authentication" do
267 setup do
275 setup do
268 @user = User.generate!
276 @user = User.generate!
269 send(http_method, url, parameters, credentials(@user.login, 'wrong_password'))
277 send(http_method, url, parameters, credentials(@user.login, 'wrong_password'))
270 end
278 end
271
279
272 should_respond_with failure_code
280 should_respond_with failure_code
273 should_respond_with_content_type_based_on_url(url)
281 should_respond_with_content_type_based_on_url(url)
274 should "not login as the user" do
282 should "not login as the user" do
275 assert_equal User.anonymous, User.current
283 assert_equal User.anonymous, User.current
276 end
284 end
277 end
285 end
278
286
279 context "without credentials" do
287 context "without credentials" do
280 setup do
288 setup do
281 send(http_method, url, parameters)
289 send(http_method, url, parameters)
282 end
290 end
283
291
284 should_respond_with failure_code
292 should_respond_with failure_code
285 should_respond_with_content_type_based_on_url(url)
293 should_respond_with_content_type_based_on_url(url)
286 should "include_www_authenticate_header" do
294 should "include_www_authenticate_header" do
287 assert @controller.response.headers.has_key?('WWW-Authenticate')
295 assert @controller.response.headers.has_key?('WWW-Authenticate')
288 end
296 end
289 end
297 end
290 end
298 end
291 end
299 end
292
300
293 # Test that a request allows the API key with HTTP BASIC
301 # Test that a request allows the API key with HTTP BASIC
294 #
302 #
295 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
303 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
296 # @param [String] url the request url
304 # @param [String] url the request url
297 # @param [optional, Hash] parameters additional request parameters
305 # @param [optional, Hash] parameters additional request parameters
298 # @param [optional, Hash] options additional options
306 # @param [optional, Hash] options additional options
299 # @option options [Symbol] :success_code Successful response code (:success)
307 # @option options [Symbol] :success_code Successful response code (:success)
300 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
308 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
301 def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={})
309 def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={})
302 success_code = options[:success_code] || :success
310 success_code = options[:success_code] || :success
303 failure_code = options[:failure_code] || :unauthorized
311 failure_code = options[:failure_code] || :unauthorized
304
312
305 context "should allow http basic auth with a key for #{http_method} #{url}" do
313 context "should allow http basic auth with a key for #{http_method} #{url}" do
306 context "with a valid HTTP authentication using the API token" do
314 context "with a valid HTTP authentication using the API token" do
307 setup do
315 setup do
308 @user = User.generate! do |user|
316 @user = User.generate! do |user|
309 user.admin = true
317 user.admin = true
310 end
318 end
311 @token = Token.create!(:user => @user, :action => 'api')
319 @token = Token.create!(:user => @user, :action => 'api')
312 send(http_method, url, parameters, credentials(@token.value, 'X'))
320 send(http_method, url, parameters, credentials(@token.value, 'X'))
313 end
321 end
314 should_respond_with success_code
322 should_respond_with success_code
315 should_respond_with_content_type_based_on_url(url)
323 should_respond_with_content_type_based_on_url(url)
316 should_be_a_valid_response_string_based_on_url(url)
324 should_be_a_valid_response_string_based_on_url(url)
317 should "login as the user" do
325 should "login as the user" do
318 assert_equal @user, User.current
326 assert_equal @user, User.current
319 end
327 end
320 end
328 end
321
329
322 context "with an invalid HTTP authentication" do
330 context "with an invalid HTTP authentication" do
323 setup do
331 setup do
324 @user = User.generate!
332 @user = User.generate!
325 @token = Token.create!(:user => @user, :action => 'feeds')
333 @token = Token.create!(:user => @user, :action => 'feeds')
326 send(http_method, url, parameters, credentials(@token.value, 'X'))
334 send(http_method, url, parameters, credentials(@token.value, 'X'))
327 end
335 end
328 should_respond_with failure_code
336 should_respond_with failure_code
329 should_respond_with_content_type_based_on_url(url)
337 should_respond_with_content_type_based_on_url(url)
330 should "not login as the user" do
338 should "not login as the user" do
331 assert_equal User.anonymous, User.current
339 assert_equal User.anonymous, User.current
332 end
340 end
333 end
341 end
334 end
342 end
335 end
343 end
336
344
337 # Test that a request allows full key authentication
345 # Test that a request allows full key authentication
338 #
346 #
339 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
347 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
340 # @param [String] url the request url, without the key=ZXY parameter
348 # @param [String] url the request url, without the key=ZXY parameter
341 # @param [optional, Hash] parameters additional request parameters
349 # @param [optional, Hash] parameters additional request parameters
342 # @param [optional, Hash] options additional options
350 # @param [optional, Hash] options additional options
343 # @option options [Symbol] :success_code Successful response code (:success)
351 # @option options [Symbol] :success_code Successful response code (:success)
344 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
352 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
345 def self.should_allow_key_based_auth(http_method, url, parameters={}, options={})
353 def self.should_allow_key_based_auth(http_method, url, parameters={}, options={})
346 success_code = options[:success_code] || :success
354 success_code = options[:success_code] || :success
347 failure_code = options[:failure_code] || :unauthorized
355 failure_code = options[:failure_code] || :unauthorized
348
356
349 context "should allow key based auth using key=X for #{http_method} #{url}" do
357 context "should allow key based auth using key=X for #{http_method} #{url}" do
350 context "with a valid api token" do
358 context "with a valid api token" do
351 setup do
359 setup do
352 @user = User.generate! do |user|
360 @user = User.generate! do |user|
353 user.admin = true
361 user.admin = true
354 end
362 end
355 @token = Token.create!(:user => @user, :action => 'api')
363 @token = Token.create!(:user => @user, :action => 'api')
356 # Simple url parse to add on ?key= or &key=
364 # Simple url parse to add on ?key= or &key=
357 request_url = if url.match(/\?/)
365 request_url = if url.match(/\?/)
358 url + "&key=#{@token.value}"
366 url + "&key=#{@token.value}"
359 else
367 else
360 url + "?key=#{@token.value}"
368 url + "?key=#{@token.value}"
361 end
369 end
362 send(http_method, request_url, parameters)
370 send(http_method, request_url, parameters)
363 end
371 end
364 should_respond_with success_code
372 should_respond_with success_code
365 should_respond_with_content_type_based_on_url(url)
373 should_respond_with_content_type_based_on_url(url)
366 should_be_a_valid_response_string_based_on_url(url)
374 should_be_a_valid_response_string_based_on_url(url)
367 should "login as the user" do
375 should "login as the user" do
368 assert_equal @user, User.current
376 assert_equal @user, User.current
369 end
377 end
370 end
378 end
371
379
372 context "with an invalid api token" do
380 context "with an invalid api token" do
373 setup do
381 setup do
374 @user = User.generate! do |user|
382 @user = User.generate! do |user|
375 user.admin = true
383 user.admin = true
376 end
384 end
377 @token = Token.create!(:user => @user, :action => 'feeds')
385 @token = Token.create!(:user => @user, :action => 'feeds')
378 # Simple url parse to add on ?key= or &key=
386 # Simple url parse to add on ?key= or &key=
379 request_url = if url.match(/\?/)
387 request_url = if url.match(/\?/)
380 url + "&key=#{@token.value}"
388 url + "&key=#{@token.value}"
381 else
389 else
382 url + "?key=#{@token.value}"
390 url + "?key=#{@token.value}"
383 end
391 end
384 send(http_method, request_url, parameters)
392 send(http_method, request_url, parameters)
385 end
393 end
386 should_respond_with failure_code
394 should_respond_with failure_code
387 should_respond_with_content_type_based_on_url(url)
395 should_respond_with_content_type_based_on_url(url)
388 should "not login as the user" do
396 should "not login as the user" do
389 assert_equal User.anonymous, User.current
397 assert_equal User.anonymous, User.current
390 end
398 end
391 end
399 end
392 end
400 end
393
401
394 context "should allow key based auth using X-Redmine-API-Key header for #{http_method} #{url}" do
402 context "should allow key based auth using X-Redmine-API-Key header for #{http_method} #{url}" do
395 setup do
403 setup do
396 @user = User.generate! do |user|
404 @user = User.generate! do |user|
397 user.admin = true
405 user.admin = true
398 end
406 end
399 @token = Token.create!(:user => @user, :action => 'api')
407 @token = Token.create!(:user => @user, :action => 'api')
400 send(http_method, url, parameters, {'X-Redmine-API-Key' => @token.value.to_s})
408 send(http_method, url, parameters, {'X-Redmine-API-Key' => @token.value.to_s})
401 end
409 end
402 should_respond_with success_code
410 should_respond_with success_code
403 should_respond_with_content_type_based_on_url(url)
411 should_respond_with_content_type_based_on_url(url)
404 should_be_a_valid_response_string_based_on_url(url)
412 should_be_a_valid_response_string_based_on_url(url)
405 should "login as the user" do
413 should "login as the user" do
406 assert_equal @user, User.current
414 assert_equal @user, User.current
407 end
415 end
408 end
416 end
409 end
417 end
410
418
411 # Uses should_respond_with_content_type based on what's in the url:
419 # Uses should_respond_with_content_type based on what's in the url:
412 #
420 #
413 # '/project/issues.xml' => should_respond_with_content_type :xml
421 # '/project/issues.xml' => should_respond_with_content_type :xml
414 # '/project/issues.json' => should_respond_with_content_type :json
422 # '/project/issues.json' => should_respond_with_content_type :json
415 #
423 #
416 # @param [String] url Request
424 # @param [String] url Request
417 def self.should_respond_with_content_type_based_on_url(url)
425 def self.should_respond_with_content_type_based_on_url(url)
418 case
426 case
419 when url.match(/xml/i)
427 when url.match(/xml/i)
420 should "respond with XML" do
428 should "respond with XML" do
421 assert_equal 'application/xml', @response.content_type
429 assert_equal 'application/xml', @response.content_type
422 end
430 end
423 when url.match(/json/i)
431 when url.match(/json/i)
424 should "respond with JSON" do
432 should "respond with JSON" do
425 assert_equal 'application/json', @response.content_type
433 assert_equal 'application/json', @response.content_type
426 end
434 end
427 else
435 else
428 raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
436 raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
429 end
437 end
430 end
438 end
431
439
432 # Uses the url to assert which format the response should be in
440 # Uses the url to assert which format the response should be in
433 #
441 #
434 # '/project/issues.xml' => should_be_a_valid_xml_string
442 # '/project/issues.xml' => should_be_a_valid_xml_string
435 # '/project/issues.json' => should_be_a_valid_json_string
443 # '/project/issues.json' => should_be_a_valid_json_string
436 #
444 #
437 # @param [String] url Request
445 # @param [String] url Request
438 def self.should_be_a_valid_response_string_based_on_url(url)
446 def self.should_be_a_valid_response_string_based_on_url(url)
439 case
447 case
440 when url.match(/xml/i)
448 when url.match(/xml/i)
441 should_be_a_valid_xml_string
449 should_be_a_valid_xml_string
442 when url.match(/json/i)
450 when url.match(/json/i)
443 should_be_a_valid_json_string
451 should_be_a_valid_json_string
444 else
452 else
445 raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
453 raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
446 end
454 end
447 end
455 end
448
456
449 # Checks that the response is a valid JSON string
457 # Checks that the response is a valid JSON string
450 def self.should_be_a_valid_json_string
458 def self.should_be_a_valid_json_string
451 should "be a valid JSON string (or empty)" do
459 should "be a valid JSON string (or empty)" do
452 assert(response.body.blank? || ActiveSupport::JSON.decode(response.body))
460 assert(response.body.blank? || ActiveSupport::JSON.decode(response.body))
453 end
461 end
454 end
462 end
455
463
456 # Checks that the response is a valid XML string
464 # Checks that the response is a valid XML string
457 def self.should_be_a_valid_xml_string
465 def self.should_be_a_valid_xml_string
458 should "be a valid XML string" do
466 should "be a valid XML string" do
459 assert REXML::Document.new(response.body)
467 assert REXML::Document.new(response.body)
460 end
468 end
461 end
469 end
462
470
463 def self.should_respond_with(status)
471 def self.should_respond_with(status)
464 should "respond with #{status}" do
472 should "respond with #{status}" do
465 assert_response status
473 assert_response status
466 end
474 end
467 end
475 end
468 end
476 end
469
477
470 # Simple module to "namespace" all of the API tests
478 # Simple module to "namespace" all of the API tests
471 module ApiTest
479 module ApiTest
472 end
480 end
@@ -1,399 +1,407
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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 IssueNestedSetTest < ActiveSupport::TestCase
20 class IssueNestedSetTest < ActiveSupport::TestCase
21 fixtures :projects, :users, :members, :member_roles, :roles,
21 fixtures :projects, :users, :members, :member_roles, :roles,
22 :trackers, :projects_trackers,
22 :trackers, :projects_trackers,
23 :versions,
23 :versions,
24 :issue_statuses, :issue_categories, :issue_relations, :workflows,
24 :issue_statuses, :issue_categories, :issue_relations, :workflows,
25 :enumerations,
25 :enumerations,
26 :issues,
26 :issues,
27 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
27 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
28 :time_entries
28 :time_entries
29
29
30 self.use_transactional_fixtures = false
30 self.use_transactional_fixtures = false
31
31
32 def test_create_root_issue
32 def test_create_root_issue
33 issue1 = create_issue!
33 issue1 = create_issue!
34 issue2 = create_issue!
34 issue2 = create_issue!
35 issue1.reload
35 issue1.reload
36 issue2.reload
36 issue2.reload
37
37
38 assert_equal [issue1.id, nil, 1, 2], [issue1.root_id, issue1.parent_id, issue1.lft, issue1.rgt]
38 assert_equal [issue1.id, nil, 1, 2], [issue1.root_id, issue1.parent_id, issue1.lft, issue1.rgt]
39 assert_equal [issue2.id, nil, 1, 2], [issue2.root_id, issue2.parent_id, issue2.lft, issue2.rgt]
39 assert_equal [issue2.id, nil, 1, 2], [issue2.root_id, issue2.parent_id, issue2.lft, issue2.rgt]
40 end
40 end
41
41
42 def test_create_child_issue
42 def test_create_child_issue
43 parent = create_issue!
43 parent = create_issue!
44 child = create_issue!(:parent_issue_id => parent.id)
44 child = create_issue!(:parent_issue_id => parent.id)
45 parent.reload
45 parent.reload
46 child.reload
46 child.reload
47
47
48 assert_equal [parent.id, nil, 1, 4], [parent.root_id, parent.parent_id, parent.lft, parent.rgt]
48 assert_equal [parent.id, nil, 1, 4], [parent.root_id, parent.parent_id, parent.lft, parent.rgt]
49 assert_equal [parent.id, parent.id, 2, 3], [child.root_id, child.parent_id, child.lft, child.rgt]
49 assert_equal [parent.id, parent.id, 2, 3], [child.root_id, child.parent_id, child.lft, child.rgt]
50 end
50 end
51
51
52 def test_creating_a_child_in_different_project_should_not_validate
52 def test_creating_a_child_in_a_subproject_should_validate
53 issue = create_issue!
54 child = Issue.new(:project_id => 3, :tracker_id => 2, :author_id => 1,
55 :subject => 'child', :parent_issue_id => issue.id)
56 assert_save child
57 assert_equal issue, child.reload.parent
58 end
59
60 def test_creating_a_child_in_an_invalid_project_should_not_validate
53 issue = create_issue!
61 issue = create_issue!
54 child = Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
62 child = Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
55 :subject => 'child', :parent_issue_id => issue.id)
63 :subject => 'child', :parent_issue_id => issue.id)
56 assert !child.save
64 assert !child.save
57 assert_not_nil child.errors[:parent_issue_id]
65 assert_not_nil child.errors[:parent_issue_id]
58 end
66 end
59
67
60 def test_move_a_root_to_child
68 def test_move_a_root_to_child
61 parent1 = create_issue!
69 parent1 = create_issue!
62 parent2 = create_issue!
70 parent2 = create_issue!
63 child = create_issue!(:parent_issue_id => parent1.id)
71 child = create_issue!(:parent_issue_id => parent1.id)
64
72
65 parent2.parent_issue_id = parent1.id
73 parent2.parent_issue_id = parent1.id
66 parent2.save!
74 parent2.save!
67 child.reload
75 child.reload
68 parent1.reload
76 parent1.reload
69 parent2.reload
77 parent2.reload
70
78
71 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
79 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
72 assert_equal [parent1.id, 4, 5], [parent2.root_id, parent2.lft, parent2.rgt]
80 assert_equal [parent1.id, 4, 5], [parent2.root_id, parent2.lft, parent2.rgt]
73 assert_equal [parent1.id, 2, 3], [child.root_id, child.lft, child.rgt]
81 assert_equal [parent1.id, 2, 3], [child.root_id, child.lft, child.rgt]
74 end
82 end
75
83
76 def test_move_a_child_to_root
84 def test_move_a_child_to_root
77 parent1 = create_issue!
85 parent1 = create_issue!
78 parent2 = create_issue!
86 parent2 = create_issue!
79 child = create_issue!(:parent_issue_id => parent1.id)
87 child = create_issue!(:parent_issue_id => parent1.id)
80
88
81 child.parent_issue_id = nil
89 child.parent_issue_id = nil
82 child.save!
90 child.save!
83 child.reload
91 child.reload
84 parent1.reload
92 parent1.reload
85 parent2.reload
93 parent2.reload
86
94
87 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
95 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
88 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
96 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
89 assert_equal [child.id, 1, 2], [child.root_id, child.lft, child.rgt]
97 assert_equal [child.id, 1, 2], [child.root_id, child.lft, child.rgt]
90 end
98 end
91
99
92 def test_move_a_child_to_another_issue
100 def test_move_a_child_to_another_issue
93 parent1 = create_issue!
101 parent1 = create_issue!
94 parent2 = create_issue!
102 parent2 = create_issue!
95 child = create_issue!(:parent_issue_id => parent1.id)
103 child = create_issue!(:parent_issue_id => parent1.id)
96
104
97 child.parent_issue_id = parent2.id
105 child.parent_issue_id = parent2.id
98 child.save!
106 child.save!
99 child.reload
107 child.reload
100 parent1.reload
108 parent1.reload
101 parent2.reload
109 parent2.reload
102
110
103 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
111 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
104 assert_equal [parent2.id, 1, 4], [parent2.root_id, parent2.lft, parent2.rgt]
112 assert_equal [parent2.id, 1, 4], [parent2.root_id, parent2.lft, parent2.rgt]
105 assert_equal [parent2.id, 2, 3], [child.root_id, child.lft, child.rgt]
113 assert_equal [parent2.id, 2, 3], [child.root_id, child.lft, child.rgt]
106 end
114 end
107
115
108 def test_move_a_child_with_descendants_to_another_issue
116 def test_move_a_child_with_descendants_to_another_issue
109 parent1 = create_issue!
117 parent1 = create_issue!
110 parent2 = create_issue!
118 parent2 = create_issue!
111 child = create_issue!(:parent_issue_id => parent1.id)
119 child = create_issue!(:parent_issue_id => parent1.id)
112 grandchild = create_issue!(:parent_issue_id => child.id)
120 grandchild = create_issue!(:parent_issue_id => child.id)
113
121
114 parent1.reload
122 parent1.reload
115 parent2.reload
123 parent2.reload
116 child.reload
124 child.reload
117 grandchild.reload
125 grandchild.reload
118
126
119 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
127 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
120 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
128 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
121 assert_equal [parent1.id, 2, 5], [child.root_id, child.lft, child.rgt]
129 assert_equal [parent1.id, 2, 5], [child.root_id, child.lft, child.rgt]
122 assert_equal [parent1.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
130 assert_equal [parent1.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
123
131
124 child.reload.parent_issue_id = parent2.id
132 child.reload.parent_issue_id = parent2.id
125 child.save!
133 child.save!
126 child.reload
134 child.reload
127 grandchild.reload
135 grandchild.reload
128 parent1.reload
136 parent1.reload
129 parent2.reload
137 parent2.reload
130
138
131 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
139 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
132 assert_equal [parent2.id, 1, 6], [parent2.root_id, parent2.lft, parent2.rgt]
140 assert_equal [parent2.id, 1, 6], [parent2.root_id, parent2.lft, parent2.rgt]
133 assert_equal [parent2.id, 2, 5], [child.root_id, child.lft, child.rgt]
141 assert_equal [parent2.id, 2, 5], [child.root_id, child.lft, child.rgt]
134 assert_equal [parent2.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
142 assert_equal [parent2.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
135 end
143 end
136
144
137 def test_move_a_child_with_descendants_to_another_project
145 def test_move_a_child_with_descendants_to_another_project
138 parent1 = create_issue!
146 parent1 = create_issue!
139 child = create_issue!(:parent_issue_id => parent1.id)
147 child = create_issue!(:parent_issue_id => parent1.id)
140 grandchild = create_issue!(:parent_issue_id => child.id)
148 grandchild = create_issue!(:parent_issue_id => child.id)
141
149
142 child.reload
150 child.reload
143 child.project = Project.find(2)
151 child.project = Project.find(2)
144 assert child.save
152 assert child.save
145 child.reload
153 child.reload
146 grandchild.reload
154 grandchild.reload
147 parent1.reload
155 parent1.reload
148
156
149 assert_equal [1, parent1.id, 1, 2], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
157 assert_equal [1, parent1.id, 1, 2], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
150 assert_equal [2, child.id, 1, 4], [child.project_id, child.root_id, child.lft, child.rgt]
158 assert_equal [2, child.id, 1, 4], [child.project_id, child.root_id, child.lft, child.rgt]
151 assert_equal [2, child.id, 2, 3], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
159 assert_equal [2, child.id, 2, 3], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
152 end
160 end
153
161
154 def test_invalid_move_to_another_project
162 def test_invalid_move_to_another_project
155 parent1 = create_issue!
163 parent1 = create_issue!
156 child = create_issue!(:parent_issue_id => parent1.id)
164 child = create_issue!(:parent_issue_id => parent1.id)
157 grandchild = create_issue!(:parent_issue_id => child.id, :tracker_id => 2)
165 grandchild = create_issue!(:parent_issue_id => child.id, :tracker_id => 2)
158 Project.find(2).tracker_ids = [1]
166 Project.find(2).tracker_ids = [1]
159
167
160 parent1.reload
168 parent1.reload
161 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
169 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
162
170
163 # child can not be moved to Project 2 because its child is on a disabled tracker
171 # child can not be moved to Project 2 because its child is on a disabled tracker
164 child = Issue.find(child.id)
172 child = Issue.find(child.id)
165 child.project = Project.find(2)
173 child.project = Project.find(2)
166 assert !child.save
174 assert !child.save
167 child.reload
175 child.reload
168 grandchild.reload
176 grandchild.reload
169 parent1.reload
177 parent1.reload
170
178
171 # no change
179 # no change
172 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
180 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
173 assert_equal [1, parent1.id, 2, 5], [child.project_id, child.root_id, child.lft, child.rgt]
181 assert_equal [1, parent1.id, 2, 5], [child.project_id, child.root_id, child.lft, child.rgt]
174 assert_equal [1, parent1.id, 3, 4], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
182 assert_equal [1, parent1.id, 3, 4], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
175 end
183 end
176
184
177 def test_moving_an_issue_to_a_descendant_should_not_validate
185 def test_moving_an_issue_to_a_descendant_should_not_validate
178 parent1 = create_issue!
186 parent1 = create_issue!
179 parent2 = create_issue!
187 parent2 = create_issue!
180 child = create_issue!(:parent_issue_id => parent1.id)
188 child = create_issue!(:parent_issue_id => parent1.id)
181 grandchild = create_issue!(:parent_issue_id => child.id)
189 grandchild = create_issue!(:parent_issue_id => child.id)
182
190
183 child.reload
191 child.reload
184 child.parent_issue_id = grandchild.id
192 child.parent_issue_id = grandchild.id
185 assert !child.save
193 assert !child.save
186 assert_not_nil child.errors[:parent_issue_id]
194 assert_not_nil child.errors[:parent_issue_id]
187 end
195 end
188
196
189 def test_moving_an_issue_should_keep_valid_relations_only
197 def test_moving_an_issue_should_keep_valid_relations_only
190 issue1 = create_issue!
198 issue1 = create_issue!
191 issue2 = create_issue!
199 issue2 = create_issue!
192 issue3 = create_issue!(:parent_issue_id => issue2.id)
200 issue3 = create_issue!(:parent_issue_id => issue2.id)
193 issue4 = create_issue!
201 issue4 = create_issue!
194 r1 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
202 r1 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
195 r2 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue3, :relation_type => IssueRelation::TYPE_PRECEDES)
203 r2 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue3, :relation_type => IssueRelation::TYPE_PRECEDES)
196 r3 = IssueRelation.create!(:issue_from => issue2, :issue_to => issue4, :relation_type => IssueRelation::TYPE_PRECEDES)
204 r3 = IssueRelation.create!(:issue_from => issue2, :issue_to => issue4, :relation_type => IssueRelation::TYPE_PRECEDES)
197 issue2.reload
205 issue2.reload
198 issue2.parent_issue_id = issue1.id
206 issue2.parent_issue_id = issue1.id
199 issue2.save!
207 issue2.save!
200 assert !IssueRelation.exists?(r1.id)
208 assert !IssueRelation.exists?(r1.id)
201 assert !IssueRelation.exists?(r2.id)
209 assert !IssueRelation.exists?(r2.id)
202 assert IssueRelation.exists?(r3.id)
210 assert IssueRelation.exists?(r3.id)
203 end
211 end
204
212
205 def test_destroy_should_destroy_children
213 def test_destroy_should_destroy_children
206 issue1 = create_issue!
214 issue1 = create_issue!
207 issue2 = create_issue!
215 issue2 = create_issue!
208 issue3 = create_issue!(:parent_issue_id => issue2.id)
216 issue3 = create_issue!(:parent_issue_id => issue2.id)
209 issue4 = create_issue!(:parent_issue_id => issue1.id)
217 issue4 = create_issue!(:parent_issue_id => issue1.id)
210
218
211 issue3.init_journal(User.find(2))
219 issue3.init_journal(User.find(2))
212 issue3.subject = 'child with journal'
220 issue3.subject = 'child with journal'
213 issue3.save!
221 issue3.save!
214
222
215 assert_difference 'Issue.count', -2 do
223 assert_difference 'Issue.count', -2 do
216 assert_difference 'Journal.count', -1 do
224 assert_difference 'Journal.count', -1 do
217 assert_difference 'JournalDetail.count', -1 do
225 assert_difference 'JournalDetail.count', -1 do
218 Issue.find(issue2.id).destroy
226 Issue.find(issue2.id).destroy
219 end
227 end
220 end
228 end
221 end
229 end
222
230
223 issue1.reload
231 issue1.reload
224 issue4.reload
232 issue4.reload
225 assert !Issue.exists?(issue2.id)
233 assert !Issue.exists?(issue2.id)
226 assert !Issue.exists?(issue3.id)
234 assert !Issue.exists?(issue3.id)
227 assert_equal [issue1.id, 1, 4], [issue1.root_id, issue1.lft, issue1.rgt]
235 assert_equal [issue1.id, 1, 4], [issue1.root_id, issue1.lft, issue1.rgt]
228 assert_equal [issue1.id, 2, 3], [issue4.root_id, issue4.lft, issue4.rgt]
236 assert_equal [issue1.id, 2, 3], [issue4.root_id, issue4.lft, issue4.rgt]
229 end
237 end
230
238
231 def test_destroy_child_should_update_parent
239 def test_destroy_child_should_update_parent
232 issue = create_issue!
240 issue = create_issue!
233 child1 = create_issue!(:parent_issue_id => issue.id)
241 child1 = create_issue!(:parent_issue_id => issue.id)
234 child2 = create_issue!(:parent_issue_id => issue.id)
242 child2 = create_issue!(:parent_issue_id => issue.id)
235
243
236 issue.reload
244 issue.reload
237 assert_equal [issue.id, 1, 6], [issue.root_id, issue.lft, issue.rgt]
245 assert_equal [issue.id, 1, 6], [issue.root_id, issue.lft, issue.rgt]
238
246
239 child2.reload.destroy
247 child2.reload.destroy
240
248
241 issue.reload
249 issue.reload
242 assert_equal [issue.id, 1, 4], [issue.root_id, issue.lft, issue.rgt]
250 assert_equal [issue.id, 1, 4], [issue.root_id, issue.lft, issue.rgt]
243 end
251 end
244
252
245 def test_destroy_parent_issue_updated_during_children_destroy
253 def test_destroy_parent_issue_updated_during_children_destroy
246 parent = create_issue!
254 parent = create_issue!
247 create_issue!(:start_date => Date.today, :parent_issue_id => parent.id)
255 create_issue!(:start_date => Date.today, :parent_issue_id => parent.id)
248 create_issue!(:start_date => 2.days.from_now, :parent_issue_id => parent.id)
256 create_issue!(:start_date => 2.days.from_now, :parent_issue_id => parent.id)
249
257
250 assert_difference 'Issue.count', -3 do
258 assert_difference 'Issue.count', -3 do
251 Issue.find(parent.id).destroy
259 Issue.find(parent.id).destroy
252 end
260 end
253 end
261 end
254
262
255 def test_destroy_child_issue_with_children
263 def test_destroy_child_issue_with_children
256 root = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'root')
264 root = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'root')
257 child = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => root.id)
265 child = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => root.id)
258 leaf = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'leaf', :parent_issue_id => child.id)
266 leaf = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'leaf', :parent_issue_id => child.id)
259 leaf.init_journal(User.find(2))
267 leaf.init_journal(User.find(2))
260 leaf.subject = 'leaf with journal'
268 leaf.subject = 'leaf with journal'
261 leaf.save!
269 leaf.save!
262
270
263 assert_difference 'Issue.count', -2 do
271 assert_difference 'Issue.count', -2 do
264 assert_difference 'Journal.count', -1 do
272 assert_difference 'Journal.count', -1 do
265 assert_difference 'JournalDetail.count', -1 do
273 assert_difference 'JournalDetail.count', -1 do
266 Issue.find(child.id).destroy
274 Issue.find(child.id).destroy
267 end
275 end
268 end
276 end
269 end
277 end
270
278
271 root = Issue.find(root.id)
279 root = Issue.find(root.id)
272 assert root.leaf?, "Root issue is not a leaf (lft: #{root.lft}, rgt: #{root.rgt})"
280 assert root.leaf?, "Root issue is not a leaf (lft: #{root.lft}, rgt: #{root.rgt})"
273 end
281 end
274
282
275 def test_destroy_issue_with_grand_child
283 def test_destroy_issue_with_grand_child
276 parent = create_issue!
284 parent = create_issue!
277 issue = create_issue!(:parent_issue_id => parent.id)
285 issue = create_issue!(:parent_issue_id => parent.id)
278 child = create_issue!(:parent_issue_id => issue.id)
286 child = create_issue!(:parent_issue_id => issue.id)
279 grandchild1 = create_issue!(:parent_issue_id => child.id)
287 grandchild1 = create_issue!(:parent_issue_id => child.id)
280 grandchild2 = create_issue!(:parent_issue_id => child.id)
288 grandchild2 = create_issue!(:parent_issue_id => child.id)
281
289
282 assert_difference 'Issue.count', -4 do
290 assert_difference 'Issue.count', -4 do
283 Issue.find(issue.id).destroy
291 Issue.find(issue.id).destroy
284 parent.reload
292 parent.reload
285 assert_equal [1, 2], [parent.lft, parent.rgt]
293 assert_equal [1, 2], [parent.lft, parent.rgt]
286 end
294 end
287 end
295 end
288
296
289 def test_parent_priority_should_be_the_highest_child_priority
297 def test_parent_priority_should_be_the_highest_child_priority
290 parent = create_issue!(:priority => IssuePriority.find_by_name('Normal'))
298 parent = create_issue!(:priority => IssuePriority.find_by_name('Normal'))
291 # Create children
299 # Create children
292 child1 = create_issue!(:priority => IssuePriority.find_by_name('High'), :parent_issue_id => parent.id)
300 child1 = create_issue!(:priority => IssuePriority.find_by_name('High'), :parent_issue_id => parent.id)
293 assert_equal 'High', parent.reload.priority.name
301 assert_equal 'High', parent.reload.priority.name
294 child2 = create_issue!(:priority => IssuePriority.find_by_name('Immediate'), :parent_issue_id => child1.id)
302 child2 = create_issue!(:priority => IssuePriority.find_by_name('Immediate'), :parent_issue_id => child1.id)
295 assert_equal 'Immediate', child1.reload.priority.name
303 assert_equal 'Immediate', child1.reload.priority.name
296 assert_equal 'Immediate', parent.reload.priority.name
304 assert_equal 'Immediate', parent.reload.priority.name
297 child3 = create_issue!(:priority => IssuePriority.find_by_name('Low'), :parent_issue_id => parent.id)
305 child3 = create_issue!(:priority => IssuePriority.find_by_name('Low'), :parent_issue_id => parent.id)
298 assert_equal 'Immediate', parent.reload.priority.name
306 assert_equal 'Immediate', parent.reload.priority.name
299 # Destroy a child
307 # Destroy a child
300 child1.destroy
308 child1.destroy
301 assert_equal 'Low', parent.reload.priority.name
309 assert_equal 'Low', parent.reload.priority.name
302 # Update a child
310 # Update a child
303 child3.reload.priority = IssuePriority.find_by_name('Normal')
311 child3.reload.priority = IssuePriority.find_by_name('Normal')
304 child3.save!
312 child3.save!
305 assert_equal 'Normal', parent.reload.priority.name
313 assert_equal 'Normal', parent.reload.priority.name
306 end
314 end
307
315
308 def test_parent_dates_should_be_lowest_start_and_highest_due_dates
316 def test_parent_dates_should_be_lowest_start_and_highest_due_dates
309 parent = create_issue!
317 parent = create_issue!
310 create_issue!(:start_date => '2010-01-25', :due_date => '2010-02-15', :parent_issue_id => parent.id)
318 create_issue!(:start_date => '2010-01-25', :due_date => '2010-02-15', :parent_issue_id => parent.id)
311 create_issue!( :due_date => '2010-02-13', :parent_issue_id => parent.id)
319 create_issue!( :due_date => '2010-02-13', :parent_issue_id => parent.id)
312 create_issue!(:start_date => '2010-02-01', :due_date => '2010-02-22', :parent_issue_id => parent.id)
320 create_issue!(:start_date => '2010-02-01', :due_date => '2010-02-22', :parent_issue_id => parent.id)
313 parent.reload
321 parent.reload
314 assert_equal Date.parse('2010-01-25'), parent.start_date
322 assert_equal Date.parse('2010-01-25'), parent.start_date
315 assert_equal Date.parse('2010-02-22'), parent.due_date
323 assert_equal Date.parse('2010-02-22'), parent.due_date
316 end
324 end
317
325
318 def test_parent_done_ratio_should_be_average_done_ratio_of_leaves
326 def test_parent_done_ratio_should_be_average_done_ratio_of_leaves
319 parent = create_issue!
327 parent = create_issue!
320 create_issue!(:done_ratio => 20, :parent_issue_id => parent.id)
328 create_issue!(:done_ratio => 20, :parent_issue_id => parent.id)
321 assert_equal 20, parent.reload.done_ratio
329 assert_equal 20, parent.reload.done_ratio
322 create_issue!(:done_ratio => 70, :parent_issue_id => parent.id)
330 create_issue!(:done_ratio => 70, :parent_issue_id => parent.id)
323 assert_equal 45, parent.reload.done_ratio
331 assert_equal 45, parent.reload.done_ratio
324
332
325 child = create_issue!(:done_ratio => 0, :parent_issue_id => parent.id)
333 child = create_issue!(:done_ratio => 0, :parent_issue_id => parent.id)
326 assert_equal 30, parent.reload.done_ratio
334 assert_equal 30, parent.reload.done_ratio
327
335
328 create_issue!(:done_ratio => 30, :parent_issue_id => child.id)
336 create_issue!(:done_ratio => 30, :parent_issue_id => child.id)
329 assert_equal 30, child.reload.done_ratio
337 assert_equal 30, child.reload.done_ratio
330 assert_equal 40, parent.reload.done_ratio
338 assert_equal 40, parent.reload.done_ratio
331 end
339 end
332
340
333 def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any
341 def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any
334 parent = create_issue!
342 parent = create_issue!
335 create_issue!(:estimated_hours => 10, :done_ratio => 20, :parent_issue_id => parent.id)
343 create_issue!(:estimated_hours => 10, :done_ratio => 20, :parent_issue_id => parent.id)
336 assert_equal 20, parent.reload.done_ratio
344 assert_equal 20, parent.reload.done_ratio
337 create_issue!(:estimated_hours => 20, :done_ratio => 50, :parent_issue_id => parent.id)
345 create_issue!(:estimated_hours => 20, :done_ratio => 50, :parent_issue_id => parent.id)
338 assert_equal (50 * 20 + 20 * 10) / 30, parent.reload.done_ratio
346 assert_equal (50 * 20 + 20 * 10) / 30, parent.reload.done_ratio
339 end
347 end
340
348
341 def test_parent_estimate_should_be_sum_of_leaves
349 def test_parent_estimate_should_be_sum_of_leaves
342 parent = create_issue!
350 parent = create_issue!
343 create_issue!(:estimated_hours => nil, :parent_issue_id => parent.id)
351 create_issue!(:estimated_hours => nil, :parent_issue_id => parent.id)
344 assert_equal nil, parent.reload.estimated_hours
352 assert_equal nil, parent.reload.estimated_hours
345 create_issue!(:estimated_hours => 5, :parent_issue_id => parent.id)
353 create_issue!(:estimated_hours => 5, :parent_issue_id => parent.id)
346 assert_equal 5, parent.reload.estimated_hours
354 assert_equal 5, parent.reload.estimated_hours
347 create_issue!(:estimated_hours => 7, :parent_issue_id => parent.id)
355 create_issue!(:estimated_hours => 7, :parent_issue_id => parent.id)
348 assert_equal 12, parent.reload.estimated_hours
356 assert_equal 12, parent.reload.estimated_hours
349 end
357 end
350
358
351 def test_move_parent_updates_old_parent_attributes
359 def test_move_parent_updates_old_parent_attributes
352 first_parent = create_issue!
360 first_parent = create_issue!
353 second_parent = create_issue!
361 second_parent = create_issue!
354 child = create_issue!(:estimated_hours => 5, :parent_issue_id => first_parent.id)
362 child = create_issue!(:estimated_hours => 5, :parent_issue_id => first_parent.id)
355 assert_equal 5, first_parent.reload.estimated_hours
363 assert_equal 5, first_parent.reload.estimated_hours
356 child.update_attributes(:estimated_hours => 7, :parent_issue_id => second_parent.id)
364 child.update_attributes(:estimated_hours => 7, :parent_issue_id => second_parent.id)
357 assert_equal 7, second_parent.reload.estimated_hours
365 assert_equal 7, second_parent.reload.estimated_hours
358 assert_nil first_parent.reload.estimated_hours
366 assert_nil first_parent.reload.estimated_hours
359 end
367 end
360
368
361 def test_reschuling_a_parent_should_reschedule_subtasks
369 def test_reschuling_a_parent_should_reschedule_subtasks
362 parent = create_issue!
370 parent = create_issue!
363 c1 = create_issue!(:start_date => '2010-05-12', :due_date => '2010-05-18', :parent_issue_id => parent.id)
371 c1 = create_issue!(:start_date => '2010-05-12', :due_date => '2010-05-18', :parent_issue_id => parent.id)
364 c2 = create_issue!(:start_date => '2010-06-03', :due_date => '2010-06-10', :parent_issue_id => parent.id)
372 c2 = create_issue!(:start_date => '2010-06-03', :due_date => '2010-06-10', :parent_issue_id => parent.id)
365 parent.reload
373 parent.reload
366 parent.reschedule_after(Date.parse('2010-06-02'))
374 parent.reschedule_after(Date.parse('2010-06-02'))
367 c1.reload
375 c1.reload
368 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-08')], [c1.start_date, c1.due_date]
376 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-08')], [c1.start_date, c1.due_date]
369 c2.reload
377 c2.reload
370 assert_equal [Date.parse('2010-06-03'), Date.parse('2010-06-10')], [c2.start_date, c2.due_date] # no change
378 assert_equal [Date.parse('2010-06-03'), Date.parse('2010-06-10')], [c2.start_date, c2.due_date] # no change
371 parent.reload
379 parent.reload
372 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-10')], [parent.start_date, parent.due_date]
380 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-10')], [parent.start_date, parent.due_date]
373 end
381 end
374
382
375 def test_project_copy_should_copy_issue_tree
383 def test_project_copy_should_copy_issue_tree
376 p = Project.create!(:name => 'Tree copy', :identifier => 'tree-copy', :tracker_ids => [1, 2])
384 p = Project.create!(:name => 'Tree copy', :identifier => 'tree-copy', :tracker_ids => [1, 2])
377 i1 = create_issue!(:project_id => p.id, :subject => 'i1')
385 i1 = create_issue!(:project_id => p.id, :subject => 'i1')
378 i2 = create_issue!(:project_id => p.id, :subject => 'i2', :parent_issue_id => i1.id)
386 i2 = create_issue!(:project_id => p.id, :subject => 'i2', :parent_issue_id => i1.id)
379 i3 = create_issue!(:project_id => p.id, :subject => 'i3', :parent_issue_id => i1.id)
387 i3 = create_issue!(:project_id => p.id, :subject => 'i3', :parent_issue_id => i1.id)
380 i4 = create_issue!(:project_id => p.id, :subject => 'i4', :parent_issue_id => i2.id)
388 i4 = create_issue!(:project_id => p.id, :subject => 'i4', :parent_issue_id => i2.id)
381 i5 = create_issue!(:project_id => p.id, :subject => 'i5')
389 i5 = create_issue!(:project_id => p.id, :subject => 'i5')
382 c = Project.new(:name => 'Copy', :identifier => 'copy', :tracker_ids => [1, 2])
390 c = Project.new(:name => 'Copy', :identifier => 'copy', :tracker_ids => [1, 2])
383 c.copy(p, :only => 'issues')
391 c.copy(p, :only => 'issues')
384 c.reload
392 c.reload
385
393
386 assert_equal 5, c.issues.count
394 assert_equal 5, c.issues.count
387 ic1, ic2, ic3, ic4, ic5 = c.issues.find(:all, :order => 'subject')
395 ic1, ic2, ic3, ic4, ic5 = c.issues.find(:all, :order => 'subject')
388 assert ic1.root?
396 assert ic1.root?
389 assert_equal ic1, ic2.parent
397 assert_equal ic1, ic2.parent
390 assert_equal ic1, ic3.parent
398 assert_equal ic1, ic3.parent
391 assert_equal ic2, ic4.parent
399 assert_equal ic2, ic4.parent
392 assert ic5.root?
400 assert ic5.root?
393 end
401 end
394
402
395 # Helper that creates an issue with default attributes
403 # Helper that creates an issue with default attributes
396 def create_issue!(attributes={})
404 def create_issue!(attributes={})
397 Issue.create!({:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'test'}.merge(attributes))
405 Issue.create!({:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'test'}.merge(attributes))
398 end
406 end
399 end
407 end
@@ -1,1592 +1,1652
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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 IssueTest < ActiveSupport::TestCase
20 class IssueTest < ActiveSupport::TestCase
21 fixtures :projects, :users, :members, :member_roles, :roles,
21 fixtures :projects, :users, :members, :member_roles, :roles,
22 :groups_users,
22 :groups_users,
23 :trackers, :projects_trackers,
23 :trackers, :projects_trackers,
24 :enabled_modules,
24 :enabled_modules,
25 :versions,
25 :versions,
26 :issue_statuses, :issue_categories, :issue_relations, :workflows,
26 :issue_statuses, :issue_categories, :issue_relations, :workflows,
27 :enumerations,
27 :enumerations,
28 :issues, :journals, :journal_details,
28 :issues, :journals, :journal_details,
29 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
29 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
30 :time_entries
30 :time_entries
31
31
32 include Redmine::I18n
32 include Redmine::I18n
33
33
34 def teardown
34 def teardown
35 User.current = nil
35 User.current = nil
36 end
36 end
37
37
38 def test_create
38 def test_create
39 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
39 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
40 :status_id => 1, :priority => IssuePriority.all.first,
40 :status_id => 1, :priority => IssuePriority.all.first,
41 :subject => 'test_create',
41 :subject => 'test_create',
42 :description => 'IssueTest#test_create', :estimated_hours => '1:30')
42 :description => 'IssueTest#test_create', :estimated_hours => '1:30')
43 assert issue.save
43 assert issue.save
44 issue.reload
44 issue.reload
45 assert_equal 1.5, issue.estimated_hours
45 assert_equal 1.5, issue.estimated_hours
46 end
46 end
47
47
48 def test_create_minimal
48 def test_create_minimal
49 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
49 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
50 :status_id => 1, :priority => IssuePriority.all.first,
50 :status_id => 1, :priority => IssuePriority.all.first,
51 :subject => 'test_create')
51 :subject => 'test_create')
52 assert issue.save
52 assert issue.save
53 assert issue.description.nil?
53 assert issue.description.nil?
54 assert_nil issue.estimated_hours
54 assert_nil issue.estimated_hours
55 end
55 end
56
56
57 def test_create_with_required_custom_field
57 def test_create_with_required_custom_field
58 set_language_if_valid 'en'
58 set_language_if_valid 'en'
59 field = IssueCustomField.find_by_name('Database')
59 field = IssueCustomField.find_by_name('Database')
60 field.update_attribute(:is_required, true)
60 field.update_attribute(:is_required, true)
61
61
62 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
62 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
63 :status_id => 1, :subject => 'test_create',
63 :status_id => 1, :subject => 'test_create',
64 :description => 'IssueTest#test_create_with_required_custom_field')
64 :description => 'IssueTest#test_create_with_required_custom_field')
65 assert issue.available_custom_fields.include?(field)
65 assert issue.available_custom_fields.include?(field)
66 # No value for the custom field
66 # No value for the custom field
67 assert !issue.save
67 assert !issue.save
68 assert_equal ["Database can't be blank"], issue.errors.full_messages
68 assert_equal ["Database can't be blank"], issue.errors.full_messages
69 # Blank value
69 # Blank value
70 issue.custom_field_values = { field.id => '' }
70 issue.custom_field_values = { field.id => '' }
71 assert !issue.save
71 assert !issue.save
72 assert_equal ["Database can't be blank"], issue.errors.full_messages
72 assert_equal ["Database can't be blank"], issue.errors.full_messages
73 # Invalid value
73 # Invalid value
74 issue.custom_field_values = { field.id => 'SQLServer' }
74 issue.custom_field_values = { field.id => 'SQLServer' }
75 assert !issue.save
75 assert !issue.save
76 assert_equal ["Database is not included in the list"], issue.errors.full_messages
76 assert_equal ["Database is not included in the list"], issue.errors.full_messages
77 # Valid value
77 # Valid value
78 issue.custom_field_values = { field.id => 'PostgreSQL' }
78 issue.custom_field_values = { field.id => 'PostgreSQL' }
79 assert issue.save
79 assert issue.save
80 issue.reload
80 issue.reload
81 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
81 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
82 end
82 end
83
83
84 def test_create_with_group_assignment
84 def test_create_with_group_assignment
85 with_settings :issue_group_assignment => '1' do
85 with_settings :issue_group_assignment => '1' do
86 assert Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
86 assert Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
87 :subject => 'Group assignment',
87 :subject => 'Group assignment',
88 :assigned_to_id => 11).save
88 :assigned_to_id => 11).save
89 issue = Issue.first(:order => 'id DESC')
89 issue = Issue.first(:order => 'id DESC')
90 assert_kind_of Group, issue.assigned_to
90 assert_kind_of Group, issue.assigned_to
91 assert_equal Group.find(11), issue.assigned_to
91 assert_equal Group.find(11), issue.assigned_to
92 end
92 end
93 end
93 end
94
94
95 def assert_visibility_match(user, issues)
95 def assert_visibility_match(user, issues)
96 assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
96 assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
97 end
97 end
98
98
99 def test_visible_scope_for_anonymous
99 def test_visible_scope_for_anonymous
100 # Anonymous user should see issues of public projects only
100 # Anonymous user should see issues of public projects only
101 issues = Issue.visible(User.anonymous).all
101 issues = Issue.visible(User.anonymous).all
102 assert issues.any?
102 assert issues.any?
103 assert_nil issues.detect {|issue| !issue.project.is_public?}
103 assert_nil issues.detect {|issue| !issue.project.is_public?}
104 assert_nil issues.detect {|issue| issue.is_private?}
104 assert_nil issues.detect {|issue| issue.is_private?}
105 assert_visibility_match User.anonymous, issues
105 assert_visibility_match User.anonymous, issues
106 end
106 end
107
107
108 def test_visible_scope_for_anonymous_without_view_issues_permissions
108 def test_visible_scope_for_anonymous_without_view_issues_permissions
109 # Anonymous user should not see issues without permission
109 # Anonymous user should not see issues without permission
110 Role.anonymous.remove_permission!(:view_issues)
110 Role.anonymous.remove_permission!(:view_issues)
111 issues = Issue.visible(User.anonymous).all
111 issues = Issue.visible(User.anonymous).all
112 assert issues.empty?
112 assert issues.empty?
113 assert_visibility_match User.anonymous, issues
113 assert_visibility_match User.anonymous, issues
114 end
114 end
115
115
116 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_default
116 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_default
117 assert Role.anonymous.update_attribute(:issues_visibility, 'default')
117 assert Role.anonymous.update_attribute(:issues_visibility, 'default')
118 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
118 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
119 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
119 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
120 assert !issue.visible?(User.anonymous)
120 assert !issue.visible?(User.anonymous)
121 end
121 end
122
122
123 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_own
123 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_own
124 assert Role.anonymous.update_attribute(:issues_visibility, 'own')
124 assert Role.anonymous.update_attribute(:issues_visibility, 'own')
125 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
125 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
126 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
126 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
127 assert !issue.visible?(User.anonymous)
127 assert !issue.visible?(User.anonymous)
128 end
128 end
129
129
130 def test_visible_scope_for_non_member
130 def test_visible_scope_for_non_member
131 user = User.find(9)
131 user = User.find(9)
132 assert user.projects.empty?
132 assert user.projects.empty?
133 # Non member user should see issues of public projects only
133 # Non member user should see issues of public projects only
134 issues = Issue.visible(user).all
134 issues = Issue.visible(user).all
135 assert issues.any?
135 assert issues.any?
136 assert_nil issues.detect {|issue| !issue.project.is_public?}
136 assert_nil issues.detect {|issue| !issue.project.is_public?}
137 assert_nil issues.detect {|issue| issue.is_private?}
137 assert_nil issues.detect {|issue| issue.is_private?}
138 assert_visibility_match user, issues
138 assert_visibility_match user, issues
139 end
139 end
140
140
141 def test_visible_scope_for_non_member_with_own_issues_visibility
141 def test_visible_scope_for_non_member_with_own_issues_visibility
142 Role.non_member.update_attribute :issues_visibility, 'own'
142 Role.non_member.update_attribute :issues_visibility, 'own'
143 Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 9, :subject => 'Issue by non member')
143 Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 9, :subject => 'Issue by non member')
144 user = User.find(9)
144 user = User.find(9)
145
145
146 issues = Issue.visible(user).all
146 issues = Issue.visible(user).all
147 assert issues.any?
147 assert issues.any?
148 assert_nil issues.detect {|issue| issue.author != user}
148 assert_nil issues.detect {|issue| issue.author != user}
149 assert_visibility_match user, issues
149 assert_visibility_match user, issues
150 end
150 end
151
151
152 def test_visible_scope_for_non_member_without_view_issues_permissions
152 def test_visible_scope_for_non_member_without_view_issues_permissions
153 # Non member user should not see issues without permission
153 # Non member user should not see issues without permission
154 Role.non_member.remove_permission!(:view_issues)
154 Role.non_member.remove_permission!(:view_issues)
155 user = User.find(9)
155 user = User.find(9)
156 assert user.projects.empty?
156 assert user.projects.empty?
157 issues = Issue.visible(user).all
157 issues = Issue.visible(user).all
158 assert issues.empty?
158 assert issues.empty?
159 assert_visibility_match user, issues
159 assert_visibility_match user, issues
160 end
160 end
161
161
162 def test_visible_scope_for_member
162 def test_visible_scope_for_member
163 user = User.find(9)
163 user = User.find(9)
164 # User should see issues of projects for which he has view_issues permissions only
164 # User should see issues of projects for which he has view_issues permissions only
165 Role.non_member.remove_permission!(:view_issues)
165 Role.non_member.remove_permission!(:view_issues)
166 Member.create!(:principal => user, :project_id => 3, :role_ids => [2])
166 Member.create!(:principal => user, :project_id => 3, :role_ids => [2])
167 issues = Issue.visible(user).all
167 issues = Issue.visible(user).all
168 assert issues.any?
168 assert issues.any?
169 assert_nil issues.detect {|issue| issue.project_id != 3}
169 assert_nil issues.detect {|issue| issue.project_id != 3}
170 assert_nil issues.detect {|issue| issue.is_private?}
170 assert_nil issues.detect {|issue| issue.is_private?}
171 assert_visibility_match user, issues
171 assert_visibility_match user, issues
172 end
172 end
173
173
174 def test_visible_scope_for_member_with_groups_should_return_assigned_issues
174 def test_visible_scope_for_member_with_groups_should_return_assigned_issues
175 user = User.find(8)
175 user = User.find(8)
176 assert user.groups.any?
176 assert user.groups.any?
177 Member.create!(:principal => user.groups.first, :project_id => 1, :role_ids => [2])
177 Member.create!(:principal => user.groups.first, :project_id => 1, :role_ids => [2])
178 Role.non_member.remove_permission!(:view_issues)
178 Role.non_member.remove_permission!(:view_issues)
179
179
180 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
180 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
181 :status_id => 1, :priority => IssuePriority.all.first,
181 :status_id => 1, :priority => IssuePriority.all.first,
182 :subject => 'Assignment test',
182 :subject => 'Assignment test',
183 :assigned_to => user.groups.first,
183 :assigned_to => user.groups.first,
184 :is_private => true)
184 :is_private => true)
185
185
186 Role.find(2).update_attribute :issues_visibility, 'default'
186 Role.find(2).update_attribute :issues_visibility, 'default'
187 issues = Issue.visible(User.find(8)).all
187 issues = Issue.visible(User.find(8)).all
188 assert issues.any?
188 assert issues.any?
189 assert issues.include?(issue)
189 assert issues.include?(issue)
190
190
191 Role.find(2).update_attribute :issues_visibility, 'own'
191 Role.find(2).update_attribute :issues_visibility, 'own'
192 issues = Issue.visible(User.find(8)).all
192 issues = Issue.visible(User.find(8)).all
193 assert issues.any?
193 assert issues.any?
194 assert issues.include?(issue)
194 assert issues.include?(issue)
195 end
195 end
196
196
197 def test_visible_scope_for_admin
197 def test_visible_scope_for_admin
198 user = User.find(1)
198 user = User.find(1)
199 user.members.each(&:destroy)
199 user.members.each(&:destroy)
200 assert user.projects.empty?
200 assert user.projects.empty?
201 issues = Issue.visible(user).all
201 issues = Issue.visible(user).all
202 assert issues.any?
202 assert issues.any?
203 # Admin should see issues on private projects that he does not belong to
203 # Admin should see issues on private projects that he does not belong to
204 assert issues.detect {|issue| !issue.project.is_public?}
204 assert issues.detect {|issue| !issue.project.is_public?}
205 # Admin should see private issues of other users
205 # Admin should see private issues of other users
206 assert issues.detect {|issue| issue.is_private? && issue.author != user}
206 assert issues.detect {|issue| issue.is_private? && issue.author != user}
207 assert_visibility_match user, issues
207 assert_visibility_match user, issues
208 end
208 end
209
209
210 def test_visible_scope_with_project
210 def test_visible_scope_with_project
211 project = Project.find(1)
211 project = Project.find(1)
212 issues = Issue.visible(User.find(2), :project => project).all
212 issues = Issue.visible(User.find(2), :project => project).all
213 projects = issues.collect(&:project).uniq
213 projects = issues.collect(&:project).uniq
214 assert_equal 1, projects.size
214 assert_equal 1, projects.size
215 assert_equal project, projects.first
215 assert_equal project, projects.first
216 end
216 end
217
217
218 def test_visible_scope_with_project_and_subprojects
218 def test_visible_scope_with_project_and_subprojects
219 project = Project.find(1)
219 project = Project.find(1)
220 issues = Issue.visible(User.find(2), :project => project, :with_subprojects => true).all
220 issues = Issue.visible(User.find(2), :project => project, :with_subprojects => true).all
221 projects = issues.collect(&:project).uniq
221 projects = issues.collect(&:project).uniq
222 assert projects.size > 1
222 assert projects.size > 1
223 assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
223 assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
224 end
224 end
225
225
226 def test_visible_and_nested_set_scopes
226 def test_visible_and_nested_set_scopes
227 assert_equal 0, Issue.find(1).descendants.visible.all.size
227 assert_equal 0, Issue.find(1).descendants.visible.all.size
228 end
228 end
229
229
230 def test_open_scope
230 def test_open_scope
231 issues = Issue.open.all
231 issues = Issue.open.all
232 assert_nil issues.detect(&:closed?)
232 assert_nil issues.detect(&:closed?)
233 end
233 end
234
234
235 def test_open_scope_with_arg
235 def test_open_scope_with_arg
236 issues = Issue.open(false).all
236 issues = Issue.open(false).all
237 assert_equal issues, issues.select(&:closed?)
237 assert_equal issues, issues.select(&:closed?)
238 end
238 end
239
239
240 def test_errors_full_messages_should_include_custom_fields_errors
240 def test_errors_full_messages_should_include_custom_fields_errors
241 field = IssueCustomField.find_by_name('Database')
241 field = IssueCustomField.find_by_name('Database')
242
242
243 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
243 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
244 :status_id => 1, :subject => 'test_create',
244 :status_id => 1, :subject => 'test_create',
245 :description => 'IssueTest#test_create_with_required_custom_field')
245 :description => 'IssueTest#test_create_with_required_custom_field')
246 assert issue.available_custom_fields.include?(field)
246 assert issue.available_custom_fields.include?(field)
247 # Invalid value
247 # Invalid value
248 issue.custom_field_values = { field.id => 'SQLServer' }
248 issue.custom_field_values = { field.id => 'SQLServer' }
249
249
250 assert !issue.valid?
250 assert !issue.valid?
251 assert_equal 1, issue.errors.full_messages.size
251 assert_equal 1, issue.errors.full_messages.size
252 assert_equal "Database #{I18n.translate('activerecord.errors.messages.inclusion')}",
252 assert_equal "Database #{I18n.translate('activerecord.errors.messages.inclusion')}",
253 issue.errors.full_messages.first
253 issue.errors.full_messages.first
254 end
254 end
255
255
256 def test_update_issue_with_required_custom_field
256 def test_update_issue_with_required_custom_field
257 field = IssueCustomField.find_by_name('Database')
257 field = IssueCustomField.find_by_name('Database')
258 field.update_attribute(:is_required, true)
258 field.update_attribute(:is_required, true)
259
259
260 issue = Issue.find(1)
260 issue = Issue.find(1)
261 assert_nil issue.custom_value_for(field)
261 assert_nil issue.custom_value_for(field)
262 assert issue.available_custom_fields.include?(field)
262 assert issue.available_custom_fields.include?(field)
263 # No change to custom values, issue can be saved
263 # No change to custom values, issue can be saved
264 assert issue.save
264 assert issue.save
265 # Blank value
265 # Blank value
266 issue.custom_field_values = { field.id => '' }
266 issue.custom_field_values = { field.id => '' }
267 assert !issue.save
267 assert !issue.save
268 # Valid value
268 # Valid value
269 issue.custom_field_values = { field.id => 'PostgreSQL' }
269 issue.custom_field_values = { field.id => 'PostgreSQL' }
270 assert issue.save
270 assert issue.save
271 issue.reload
271 issue.reload
272 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
272 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
273 end
273 end
274
274
275 def test_should_not_update_attributes_if_custom_fields_validation_fails
275 def test_should_not_update_attributes_if_custom_fields_validation_fails
276 issue = Issue.find(1)
276 issue = Issue.find(1)
277 field = IssueCustomField.find_by_name('Database')
277 field = IssueCustomField.find_by_name('Database')
278 assert issue.available_custom_fields.include?(field)
278 assert issue.available_custom_fields.include?(field)
279
279
280 issue.custom_field_values = { field.id => 'Invalid' }
280 issue.custom_field_values = { field.id => 'Invalid' }
281 issue.subject = 'Should be not be saved'
281 issue.subject = 'Should be not be saved'
282 assert !issue.save
282 assert !issue.save
283
283
284 issue.reload
284 issue.reload
285 assert_equal "Can't print recipes", issue.subject
285 assert_equal "Can't print recipes", issue.subject
286 end
286 end
287
287
288 def test_should_not_recreate_custom_values_objects_on_update
288 def test_should_not_recreate_custom_values_objects_on_update
289 field = IssueCustomField.find_by_name('Database')
289 field = IssueCustomField.find_by_name('Database')
290
290
291 issue = Issue.find(1)
291 issue = Issue.find(1)
292 issue.custom_field_values = { field.id => 'PostgreSQL' }
292 issue.custom_field_values = { field.id => 'PostgreSQL' }
293 assert issue.save
293 assert issue.save
294 custom_value = issue.custom_value_for(field)
294 custom_value = issue.custom_value_for(field)
295 issue.reload
295 issue.reload
296 issue.custom_field_values = { field.id => 'MySQL' }
296 issue.custom_field_values = { field.id => 'MySQL' }
297 assert issue.save
297 assert issue.save
298 issue.reload
298 issue.reload
299 assert_equal custom_value.id, issue.custom_value_for(field).id
299 assert_equal custom_value.id, issue.custom_value_for(field).id
300 end
300 end
301
301
302 def test_should_not_update_custom_fields_on_changing_tracker_with_different_custom_fields
302 def test_should_not_update_custom_fields_on_changing_tracker_with_different_custom_fields
303 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => 'Test', :custom_field_values => {'2' => 'Test'})
303 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => 'Test', :custom_field_values => {'2' => 'Test'})
304 assert !Tracker.find(2).custom_field_ids.include?(2)
304 assert !Tracker.find(2).custom_field_ids.include?(2)
305
305
306 issue = Issue.find(issue.id)
306 issue = Issue.find(issue.id)
307 issue.attributes = {:tracker_id => 2, :custom_field_values => {'1' => ''}}
307 issue.attributes = {:tracker_id => 2, :custom_field_values => {'1' => ''}}
308
308
309 issue = Issue.find(issue.id)
309 issue = Issue.find(issue.id)
310 custom_value = issue.custom_value_for(2)
310 custom_value = issue.custom_value_for(2)
311 assert_not_nil custom_value
311 assert_not_nil custom_value
312 assert_equal 'Test', custom_value.value
312 assert_equal 'Test', custom_value.value
313 end
313 end
314
314
315 def test_assigning_tracker_id_should_reload_custom_fields_values
315 def test_assigning_tracker_id_should_reload_custom_fields_values
316 issue = Issue.new(:project => Project.find(1))
316 issue = Issue.new(:project => Project.find(1))
317 assert issue.custom_field_values.empty?
317 assert issue.custom_field_values.empty?
318 issue.tracker_id = 1
318 issue.tracker_id = 1
319 assert issue.custom_field_values.any?
319 assert issue.custom_field_values.any?
320 end
320 end
321
321
322 def test_assigning_attributes_should_assign_project_and_tracker_first
322 def test_assigning_attributes_should_assign_project_and_tracker_first
323 seq = sequence('seq')
323 seq = sequence('seq')
324 issue = Issue.new
324 issue = Issue.new
325 issue.expects(:project_id=).in_sequence(seq)
325 issue.expects(:project_id=).in_sequence(seq)
326 issue.expects(:tracker_id=).in_sequence(seq)
326 issue.expects(:tracker_id=).in_sequence(seq)
327 issue.expects(:subject=).in_sequence(seq)
327 issue.expects(:subject=).in_sequence(seq)
328 issue.attributes = {:tracker_id => 2, :project_id => 1, :subject => 'Test'}
328 issue.attributes = {:tracker_id => 2, :project_id => 1, :subject => 'Test'}
329 end
329 end
330
330
331 def test_assigning_tracker_and_custom_fields_should_assign_custom_fields
331 def test_assigning_tracker_and_custom_fields_should_assign_custom_fields
332 attributes = ActiveSupport::OrderedHash.new
332 attributes = ActiveSupport::OrderedHash.new
333 attributes['custom_field_values'] = { '1' => 'MySQL' }
333 attributes['custom_field_values'] = { '1' => 'MySQL' }
334 attributes['tracker_id'] = '1'
334 attributes['tracker_id'] = '1'
335 issue = Issue.new(:project => Project.find(1))
335 issue = Issue.new(:project => Project.find(1))
336 issue.attributes = attributes
336 issue.attributes = attributes
337 assert_equal 'MySQL', issue.custom_field_value(1)
337 assert_equal 'MySQL', issue.custom_field_value(1)
338 end
338 end
339
339
340 def test_should_update_issue_with_disabled_tracker
340 def test_should_update_issue_with_disabled_tracker
341 p = Project.find(1)
341 p = Project.find(1)
342 issue = Issue.find(1)
342 issue = Issue.find(1)
343
343
344 p.trackers.delete(issue.tracker)
344 p.trackers.delete(issue.tracker)
345 assert !p.trackers.include?(issue.tracker)
345 assert !p.trackers.include?(issue.tracker)
346
346
347 issue.reload
347 issue.reload
348 issue.subject = 'New subject'
348 issue.subject = 'New subject'
349 assert issue.save
349 assert issue.save
350 end
350 end
351
351
352 def test_should_not_set_a_disabled_tracker
352 def test_should_not_set_a_disabled_tracker
353 p = Project.find(1)
353 p = Project.find(1)
354 p.trackers.delete(Tracker.find(2))
354 p.trackers.delete(Tracker.find(2))
355
355
356 issue = Issue.find(1)
356 issue = Issue.find(1)
357 issue.tracker_id = 2
357 issue.tracker_id = 2
358 issue.subject = 'New subject'
358 issue.subject = 'New subject'
359 assert !issue.save
359 assert !issue.save
360 assert_not_nil issue.errors[:tracker_id]
360 assert_not_nil issue.errors[:tracker_id]
361 end
361 end
362
362
363 def test_category_based_assignment
363 def test_category_based_assignment
364 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
364 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
365 :status_id => 1, :priority => IssuePriority.all.first,
365 :status_id => 1, :priority => IssuePriority.all.first,
366 :subject => 'Assignment test',
366 :subject => 'Assignment test',
367 :description => 'Assignment test', :category_id => 1)
367 :description => 'Assignment test', :category_id => 1)
368 assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to
368 assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to
369 end
369 end
370
370
371 def test_new_statuses_allowed_to
371 def test_new_statuses_allowed_to
372 WorkflowTransition.delete_all
372 WorkflowTransition.delete_all
373
373
374 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
374 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
375 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
375 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
376 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
376 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
377 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
377 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
378 status = IssueStatus.find(1)
378 status = IssueStatus.find(1)
379 role = Role.find(1)
379 role = Role.find(1)
380 tracker = Tracker.find(1)
380 tracker = Tracker.find(1)
381 user = User.find(2)
381 user = User.find(2)
382
382
383 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1)
383 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1)
384 assert_equal [1, 2], issue.new_statuses_allowed_to(user).map(&:id)
384 assert_equal [1, 2], issue.new_statuses_allowed_to(user).map(&:id)
385
385
386 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user)
386 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user)
387 assert_equal [1, 2, 3, 5], issue.new_statuses_allowed_to(user).map(&:id)
387 assert_equal [1, 2, 3, 5], issue.new_statuses_allowed_to(user).map(&:id)
388
388
389 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1, :assigned_to => user)
389 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1, :assigned_to => user)
390 assert_equal [1, 2, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
390 assert_equal [1, 2, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
391
391
392 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user, :assigned_to => user)
392 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user, :assigned_to => user)
393 assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
393 assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
394 end
394 end
395
395
396 def test_new_statuses_allowed_to_should_return_all_transitions_for_admin
396 def test_new_statuses_allowed_to_should_return_all_transitions_for_admin
397 admin = User.find(1)
397 admin = User.find(1)
398 issue = Issue.find(1)
398 issue = Issue.find(1)
399 assert !admin.member_of?(issue.project)
399 assert !admin.member_of?(issue.project)
400 expected_statuses = [issue.status] + WorkflowTransition.find_all_by_old_status_id(issue.status_id).map(&:new_status).uniq.sort
400 expected_statuses = [issue.status] + WorkflowTransition.find_all_by_old_status_id(issue.status_id).map(&:new_status).uniq.sort
401
401
402 assert_equal expected_statuses, issue.new_statuses_allowed_to(admin)
402 assert_equal expected_statuses, issue.new_statuses_allowed_to(admin)
403 end
403 end
404
404
405 def test_new_statuses_allowed_to_should_return_default_and_current_status_when_copying
405 def test_new_statuses_allowed_to_should_return_default_and_current_status_when_copying
406 issue = Issue.find(1).copy
406 issue = Issue.find(1).copy
407 assert_equal [1], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
407 assert_equal [1], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
408
408
409 issue = Issue.find(2).copy
409 issue = Issue.find(2).copy
410 assert_equal [1, 2], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
410 assert_equal [1, 2], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
411 end
411 end
412
412
413 def test_safe_attributes_names_should_not_include_disabled_field
413 def test_safe_attributes_names_should_not_include_disabled_field
414 tracker = Tracker.new(:core_fields => %w(assigned_to_id fixed_version_id))
414 tracker = Tracker.new(:core_fields => %w(assigned_to_id fixed_version_id))
415
415
416 issue = Issue.new(:tracker => tracker)
416 issue = Issue.new(:tracker => tracker)
417 assert_include 'tracker_id', issue.safe_attribute_names
417 assert_include 'tracker_id', issue.safe_attribute_names
418 assert_include 'status_id', issue.safe_attribute_names
418 assert_include 'status_id', issue.safe_attribute_names
419 assert_include 'subject', issue.safe_attribute_names
419 assert_include 'subject', issue.safe_attribute_names
420 assert_include 'description', issue.safe_attribute_names
420 assert_include 'description', issue.safe_attribute_names
421 assert_include 'custom_field_values', issue.safe_attribute_names
421 assert_include 'custom_field_values', issue.safe_attribute_names
422 assert_include 'custom_fields', issue.safe_attribute_names
422 assert_include 'custom_fields', issue.safe_attribute_names
423 assert_include 'lock_version', issue.safe_attribute_names
423 assert_include 'lock_version', issue.safe_attribute_names
424
424
425 tracker.core_fields.each do |field|
425 tracker.core_fields.each do |field|
426 assert_include field, issue.safe_attribute_names
426 assert_include field, issue.safe_attribute_names
427 end
427 end
428
428
429 tracker.disabled_core_fields.each do |field|
429 tracker.disabled_core_fields.each do |field|
430 assert_not_include field, issue.safe_attribute_names
430 assert_not_include field, issue.safe_attribute_names
431 end
431 end
432 end
432 end
433
433
434 def test_safe_attributes_should_ignore_disabled_fields
434 def test_safe_attributes_should_ignore_disabled_fields
435 tracker = Tracker.find(1)
435 tracker = Tracker.find(1)
436 tracker.core_fields = %w(assigned_to_id due_date)
436 tracker.core_fields = %w(assigned_to_id due_date)
437 tracker.save!
437 tracker.save!
438
438
439 issue = Issue.new(:tracker => tracker)
439 issue = Issue.new(:tracker => tracker)
440 issue.safe_attributes = {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}
440 issue.safe_attributes = {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}
441 assert_nil issue.start_date
441 assert_nil issue.start_date
442 assert_equal Date.parse('2012-07-14'), issue.due_date
442 assert_equal Date.parse('2012-07-14'), issue.due_date
443 end
443 end
444
444
445 def test_safe_attributes_should_accept_target_tracker_enabled_fields
445 def test_safe_attributes_should_accept_target_tracker_enabled_fields
446 source = Tracker.find(1)
446 source = Tracker.find(1)
447 source.core_fields = []
447 source.core_fields = []
448 source.save!
448 source.save!
449 target = Tracker.find(2)
449 target = Tracker.find(2)
450 target.core_fields = %w(assigned_to_id due_date)
450 target.core_fields = %w(assigned_to_id due_date)
451 target.save!
451 target.save!
452
452
453 issue = Issue.new(:tracker => source)
453 issue = Issue.new(:tracker => source)
454 issue.safe_attributes = {'tracker_id' => 2, 'due_date' => '2012-07-14'}
454 issue.safe_attributes = {'tracker_id' => 2, 'due_date' => '2012-07-14'}
455 assert_equal target, issue.tracker
455 assert_equal target, issue.tracker
456 assert_equal Date.parse('2012-07-14'), issue.due_date
456 assert_equal Date.parse('2012-07-14'), issue.due_date
457 end
457 end
458
458
459 def test_safe_attributes_should_not_include_readonly_fields
459 def test_safe_attributes_should_not_include_readonly_fields
460 WorkflowPermission.delete_all
460 WorkflowPermission.delete_all
461 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
461 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
462 user = User.find(2)
462 user = User.find(2)
463
463
464 issue = Issue.new(:project_id => 1, :tracker_id => 1)
464 issue = Issue.new(:project_id => 1, :tracker_id => 1)
465 assert_equal %w(due_date), issue.read_only_attribute_names(user)
465 assert_equal %w(due_date), issue.read_only_attribute_names(user)
466 assert_not_include 'due_date', issue.safe_attribute_names(user)
466 assert_not_include 'due_date', issue.safe_attribute_names(user)
467
467
468 issue.send :safe_attributes=, {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}, user
468 issue.send :safe_attributes=, {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}, user
469 assert_equal Date.parse('2012-07-14'), issue.start_date
469 assert_equal Date.parse('2012-07-14'), issue.start_date
470 assert_nil issue.due_date
470 assert_nil issue.due_date
471 end
471 end
472
472
473 def test_safe_attributes_should_not_include_readonly_custom_fields
473 def test_safe_attributes_should_not_include_readonly_custom_fields
474 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
474 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
475 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
475 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
476
476
477 WorkflowPermission.delete_all
477 WorkflowPermission.delete_all
478 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
478 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
479 user = User.find(2)
479 user = User.find(2)
480
480
481 issue = Issue.new(:project_id => 1, :tracker_id => 1)
481 issue = Issue.new(:project_id => 1, :tracker_id => 1)
482 assert_equal [cf2.id.to_s], issue.read_only_attribute_names(user)
482 assert_equal [cf2.id.to_s], issue.read_only_attribute_names(user)
483 assert_not_include cf2.id.to_s, issue.safe_attribute_names(user)
483 assert_not_include cf2.id.to_s, issue.safe_attribute_names(user)
484
484
485 issue.send :safe_attributes=, {'custom_field_values' => {cf1.id.to_s => 'value1', cf2.id.to_s => 'value2'}}, user
485 issue.send :safe_attributes=, {'custom_field_values' => {cf1.id.to_s => 'value1', cf2.id.to_s => 'value2'}}, user
486 assert_equal 'value1', issue.custom_field_value(cf1)
486 assert_equal 'value1', issue.custom_field_value(cf1)
487 assert_nil issue.custom_field_value(cf2)
487 assert_nil issue.custom_field_value(cf2)
488
488
489 issue.send :safe_attributes=, {'custom_fields' => [{'id' => cf1.id.to_s, 'value' => 'valuea'}, {'id' => cf2.id.to_s, 'value' => 'valueb'}]}, user
489 issue.send :safe_attributes=, {'custom_fields' => [{'id' => cf1.id.to_s, 'value' => 'valuea'}, {'id' => cf2.id.to_s, 'value' => 'valueb'}]}, user
490 assert_equal 'valuea', issue.custom_field_value(cf1)
490 assert_equal 'valuea', issue.custom_field_value(cf1)
491 assert_nil issue.custom_field_value(cf2)
491 assert_nil issue.custom_field_value(cf2)
492 end
492 end
493
493
494 def test_editable_custom_field_values_should_return_non_readonly_custom_values
494 def test_editable_custom_field_values_should_return_non_readonly_custom_values
495 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
495 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
496 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
496 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
497
497
498 WorkflowPermission.delete_all
498 WorkflowPermission.delete_all
499 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
499 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
500 user = User.find(2)
500 user = User.find(2)
501
501
502 issue = Issue.new(:project_id => 1, :tracker_id => 1)
502 issue = Issue.new(:project_id => 1, :tracker_id => 1)
503 values = issue.editable_custom_field_values(user)
503 values = issue.editable_custom_field_values(user)
504 assert values.detect {|value| value.custom_field == cf1}
504 assert values.detect {|value| value.custom_field == cf1}
505 assert_nil values.detect {|value| value.custom_field == cf2}
505 assert_nil values.detect {|value| value.custom_field == cf2}
506
506
507 issue.tracker_id = 2
507 issue.tracker_id = 2
508 values = issue.editable_custom_field_values(user)
508 values = issue.editable_custom_field_values(user)
509 assert values.detect {|value| value.custom_field == cf1}
509 assert values.detect {|value| value.custom_field == cf1}
510 assert values.detect {|value| value.custom_field == cf2}
510 assert values.detect {|value| value.custom_field == cf2}
511 end
511 end
512
512
513 def test_safe_attributes_should_accept_target_tracker_writable_fields
513 def test_safe_attributes_should_accept_target_tracker_writable_fields
514 WorkflowPermission.delete_all
514 WorkflowPermission.delete_all
515 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
515 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
516 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
516 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
517 user = User.find(2)
517 user = User.find(2)
518
518
519 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
519 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
520
520
521 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
521 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
522 assert_equal Date.parse('2012-07-12'), issue.start_date
522 assert_equal Date.parse('2012-07-12'), issue.start_date
523 assert_nil issue.due_date
523 assert_nil issue.due_date
524
524
525 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'tracker_id' => 2}, user
525 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'tracker_id' => 2}, user
526 assert_equal Date.parse('2012-07-12'), issue.start_date
526 assert_equal Date.parse('2012-07-12'), issue.start_date
527 assert_equal Date.parse('2012-07-16'), issue.due_date
527 assert_equal Date.parse('2012-07-16'), issue.due_date
528 end
528 end
529
529
530 def test_safe_attributes_should_accept_target_status_writable_fields
530 def test_safe_attributes_should_accept_target_status_writable_fields
531 WorkflowPermission.delete_all
531 WorkflowPermission.delete_all
532 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
532 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
533 WorkflowPermission.create!(:old_status_id => 2, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
533 WorkflowPermission.create!(:old_status_id => 2, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
534 user = User.find(2)
534 user = User.find(2)
535
535
536 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
536 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
537
537
538 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
538 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
539 assert_equal Date.parse('2012-07-12'), issue.start_date
539 assert_equal Date.parse('2012-07-12'), issue.start_date
540 assert_nil issue.due_date
540 assert_nil issue.due_date
541
541
542 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'status_id' => 2}, user
542 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'status_id' => 2}, user
543 assert_equal Date.parse('2012-07-12'), issue.start_date
543 assert_equal Date.parse('2012-07-12'), issue.start_date
544 assert_equal Date.parse('2012-07-16'), issue.due_date
544 assert_equal Date.parse('2012-07-16'), issue.due_date
545 end
545 end
546
546
547 def test_required_attributes_should_be_validated
547 def test_required_attributes_should_be_validated
548 cf = IssueCustomField.create!(:name => 'Foo', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
548 cf = IssueCustomField.create!(:name => 'Foo', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
549
549
550 WorkflowPermission.delete_all
550 WorkflowPermission.delete_all
551 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
551 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
552 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'category_id', :rule => 'required')
552 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'category_id', :rule => 'required')
553 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
553 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
554
554
555 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'required')
555 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'required')
556 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
556 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
557 user = User.find(2)
557 user = User.find(2)
558
558
559 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Required fields', :author => user)
559 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Required fields', :author => user)
560 assert_equal [cf.id.to_s, "category_id", "due_date"], issue.required_attribute_names(user).sort
560 assert_equal [cf.id.to_s, "category_id", "due_date"], issue.required_attribute_names(user).sort
561 assert !issue.save, "Issue was saved"
561 assert !issue.save, "Issue was saved"
562 assert_equal ["Category can't be blank", "Due date can't be blank", "Foo can't be blank"], issue.errors.full_messages.sort
562 assert_equal ["Category can't be blank", "Due date can't be blank", "Foo can't be blank"], issue.errors.full_messages.sort
563
563
564 issue.tracker_id = 2
564 issue.tracker_id = 2
565 assert_equal [cf.id.to_s, "start_date"], issue.required_attribute_names(user).sort
565 assert_equal [cf.id.to_s, "start_date"], issue.required_attribute_names(user).sort
566 assert !issue.save, "Issue was saved"
566 assert !issue.save, "Issue was saved"
567 assert_equal ["Foo can't be blank", "Start date can't be blank"], issue.errors.full_messages.sort
567 assert_equal ["Foo can't be blank", "Start date can't be blank"], issue.errors.full_messages.sort
568
568
569 issue.start_date = Date.today
569 issue.start_date = Date.today
570 issue.custom_field_values = {cf.id.to_s => 'bar'}
570 issue.custom_field_values = {cf.id.to_s => 'bar'}
571 assert issue.save
571 assert issue.save
572 end
572 end
573
573
574 def test_required_attribute_names_for_multiple_roles_should_intersect_rules
574 def test_required_attribute_names_for_multiple_roles_should_intersect_rules
575 WorkflowPermission.delete_all
575 WorkflowPermission.delete_all
576 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
576 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
577 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'required')
577 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'required')
578 user = User.find(2)
578 user = User.find(2)
579 member = Member.find(1)
579 member = Member.find(1)
580 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
580 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
581
581
582 assert_equal %w(due_date start_date), issue.required_attribute_names(user).sort
582 assert_equal %w(due_date start_date), issue.required_attribute_names(user).sort
583
583
584 member.role_ids = [1, 2]
584 member.role_ids = [1, 2]
585 member.save!
585 member.save!
586 assert_equal [], issue.required_attribute_names(user.reload)
586 assert_equal [], issue.required_attribute_names(user.reload)
587
587
588 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'required')
588 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'required')
589 assert_equal %w(due_date), issue.required_attribute_names(user)
589 assert_equal %w(due_date), issue.required_attribute_names(user)
590
590
591 member.role_ids = [1, 2, 3]
591 member.role_ids = [1, 2, 3]
592 member.save!
592 member.save!
593 assert_equal [], issue.required_attribute_names(user.reload)
593 assert_equal [], issue.required_attribute_names(user.reload)
594
594
595 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
595 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
596 # required + readonly => required
596 # required + readonly => required
597 assert_equal %w(due_date), issue.required_attribute_names(user)
597 assert_equal %w(due_date), issue.required_attribute_names(user)
598 end
598 end
599
599
600 def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules
600 def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules
601 WorkflowPermission.delete_all
601 WorkflowPermission.delete_all
602 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
602 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
603 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
603 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
604 user = User.find(2)
604 user = User.find(2)
605 member = Member.find(1)
605 member = Member.find(1)
606 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
606 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
607
607
608 assert_equal %w(due_date start_date), issue.read_only_attribute_names(user).sort
608 assert_equal %w(due_date start_date), issue.read_only_attribute_names(user).sort
609
609
610 member.role_ids = [1, 2]
610 member.role_ids = [1, 2]
611 member.save!
611 member.save!
612 assert_equal [], issue.read_only_attribute_names(user.reload)
612 assert_equal [], issue.read_only_attribute_names(user.reload)
613
613
614 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
614 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
615 assert_equal %w(due_date), issue.read_only_attribute_names(user)
615 assert_equal %w(due_date), issue.read_only_attribute_names(user)
616 end
616 end
617
617
618 def test_copy
618 def test_copy
619 issue = Issue.new.copy_from(1)
619 issue = Issue.new.copy_from(1)
620 assert issue.copy?
620 assert issue.copy?
621 assert issue.save
621 assert issue.save
622 issue.reload
622 issue.reload
623 orig = Issue.find(1)
623 orig = Issue.find(1)
624 assert_equal orig.subject, issue.subject
624 assert_equal orig.subject, issue.subject
625 assert_equal orig.tracker, issue.tracker
625 assert_equal orig.tracker, issue.tracker
626 assert_equal "125", issue.custom_value_for(2).value
626 assert_equal "125", issue.custom_value_for(2).value
627 end
627 end
628
628
629 def test_copy_should_copy_status
629 def test_copy_should_copy_status
630 orig = Issue.find(8)
630 orig = Issue.find(8)
631 assert orig.status != IssueStatus.default
631 assert orig.status != IssueStatus.default
632
632
633 issue = Issue.new.copy_from(orig)
633 issue = Issue.new.copy_from(orig)
634 assert issue.save
634 assert issue.save
635 issue.reload
635 issue.reload
636 assert_equal orig.status, issue.status
636 assert_equal orig.status, issue.status
637 end
637 end
638
638
639 def test_copy_should_add_relation_with_copied_issue
639 def test_copy_should_add_relation_with_copied_issue
640 copied = Issue.find(1)
640 copied = Issue.find(1)
641 issue = Issue.new.copy_from(copied)
641 issue = Issue.new.copy_from(copied)
642 assert issue.save
642 assert issue.save
643 issue.reload
643 issue.reload
644
644
645 assert_equal 1, issue.relations.size
645 assert_equal 1, issue.relations.size
646 relation = issue.relations.first
646 relation = issue.relations.first
647 assert_equal 'copied_to', relation.relation_type
647 assert_equal 'copied_to', relation.relation_type
648 assert_equal copied, relation.issue_from
648 assert_equal copied, relation.issue_from
649 assert_equal issue, relation.issue_to
649 assert_equal issue, relation.issue_to
650 end
650 end
651
651
652 def test_copy_should_copy_subtasks
652 def test_copy_should_copy_subtasks
653 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
653 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
654
654
655 copy = issue.reload.copy
655 copy = issue.reload.copy
656 copy.author = User.find(7)
656 copy.author = User.find(7)
657 assert_difference 'Issue.count', 1+issue.descendants.count do
657 assert_difference 'Issue.count', 1+issue.descendants.count do
658 assert copy.save
658 assert copy.save
659 end
659 end
660 copy.reload
660 copy.reload
661 assert_equal %w(Child1 Child2), copy.children.map(&:subject).sort
661 assert_equal %w(Child1 Child2), copy.children.map(&:subject).sort
662 child_copy = copy.children.detect {|c| c.subject == 'Child1'}
662 child_copy = copy.children.detect {|c| c.subject == 'Child1'}
663 assert_equal %w(Child11), child_copy.children.map(&:subject).sort
663 assert_equal %w(Child11), child_copy.children.map(&:subject).sort
664 assert_equal copy.author, child_copy.author
664 assert_equal copy.author, child_copy.author
665 end
665 end
666
666
667 def test_copy_should_copy_subtasks_to_target_project
667 def test_copy_should_copy_subtasks_to_target_project
668 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
668 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
669
669
670 copy = issue.copy(:project_id => 3)
670 copy = issue.copy(:project_id => 3)
671 assert_difference 'Issue.count', 1+issue.descendants.count do
671 assert_difference 'Issue.count', 1+issue.descendants.count do
672 assert copy.save
672 assert copy.save
673 end
673 end
674 assert_equal [3], copy.reload.descendants.map(&:project_id).uniq
674 assert_equal [3], copy.reload.descendants.map(&:project_id).uniq
675 end
675 end
676
676
677 def test_copy_should_not_copy_subtasks_twice_when_saving_twice
677 def test_copy_should_not_copy_subtasks_twice_when_saving_twice
678 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
678 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
679
679
680 copy = issue.reload.copy
680 copy = issue.reload.copy
681 assert_difference 'Issue.count', 1+issue.descendants.count do
681 assert_difference 'Issue.count', 1+issue.descendants.count do
682 assert copy.save
682 assert copy.save
683 assert copy.save
683 assert copy.save
684 end
684 end
685 end
685 end
686
686
687 def test_should_not_call_after_project_change_on_creation
687 def test_should_not_call_after_project_change_on_creation
688 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Test', :author_id => 1)
688 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Test', :author_id => 1)
689 issue.expects(:after_project_change).never
689 issue.expects(:after_project_change).never
690 issue.save!
690 issue.save!
691 end
691 end
692
692
693 def test_should_not_call_after_project_change_on_update
693 def test_should_not_call_after_project_change_on_update
694 issue = Issue.find(1)
694 issue = Issue.find(1)
695 issue.project = Project.find(1)
695 issue.project = Project.find(1)
696 issue.subject = 'No project change'
696 issue.subject = 'No project change'
697 issue.expects(:after_project_change).never
697 issue.expects(:after_project_change).never
698 issue.save!
698 issue.save!
699 end
699 end
700
700
701 def test_should_call_after_project_change_on_project_change
701 def test_should_call_after_project_change_on_project_change
702 issue = Issue.find(1)
702 issue = Issue.find(1)
703 issue.project = Project.find(2)
703 issue.project = Project.find(2)
704 issue.expects(:after_project_change).once
704 issue.expects(:after_project_change).once
705 issue.save!
705 issue.save!
706 end
706 end
707
707
708 def test_adding_journal_should_update_timestamp
708 def test_adding_journal_should_update_timestamp
709 issue = Issue.find(1)
709 issue = Issue.find(1)
710 updated_on_was = issue.updated_on
710 updated_on_was = issue.updated_on
711
711
712 issue.init_journal(User.first, "Adding notes")
712 issue.init_journal(User.first, "Adding notes")
713 assert_difference 'Journal.count' do
713 assert_difference 'Journal.count' do
714 assert issue.save
714 assert issue.save
715 end
715 end
716 issue.reload
716 issue.reload
717
717
718 assert_not_equal updated_on_was, issue.updated_on
718 assert_not_equal updated_on_was, issue.updated_on
719 end
719 end
720
720
721 def test_should_close_duplicates
721 def test_should_close_duplicates
722 # Create 3 issues
722 # Create 3 issues
723 project = Project.find(1)
723 project = Project.find(1)
724 issue1 = Issue.generate_for_project!(project)
724 issue1 = Issue.generate_for_project!(project)
725 issue2 = Issue.generate_for_project!(project)
725 issue2 = Issue.generate_for_project!(project)
726 issue3 = Issue.generate_for_project!(project)
726 issue3 = Issue.generate_for_project!(project)
727
727
728 # 2 is a dupe of 1
728 # 2 is a dupe of 1
729 IssueRelation.create!(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
729 IssueRelation.create!(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
730 # And 3 is a dupe of 2
730 # And 3 is a dupe of 2
731 IssueRelation.create!(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
731 IssueRelation.create!(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
732 # And 3 is a dupe of 1 (circular duplicates)
732 # And 3 is a dupe of 1 (circular duplicates)
733 IssueRelation.create!(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
733 IssueRelation.create!(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
734
734
735 assert issue1.reload.duplicates.include?(issue2)
735 assert issue1.reload.duplicates.include?(issue2)
736
736
737 # Closing issue 1
737 # Closing issue 1
738 issue1.init_journal(User.find(:first), "Closing issue1")
738 issue1.init_journal(User.find(:first), "Closing issue1")
739 issue1.status = IssueStatus.find :first, :conditions => {:is_closed => true}
739 issue1.status = IssueStatus.find :first, :conditions => {:is_closed => true}
740 assert issue1.save
740 assert issue1.save
741 # 2 and 3 should be also closed
741 # 2 and 3 should be also closed
742 assert issue2.reload.closed?
742 assert issue2.reload.closed?
743 assert issue3.reload.closed?
743 assert issue3.reload.closed?
744 end
744 end
745
745
746 def test_should_not_close_duplicated_issue
746 def test_should_not_close_duplicated_issue
747 project = Project.find(1)
747 project = Project.find(1)
748 issue1 = Issue.generate_for_project!(project)
748 issue1 = Issue.generate_for_project!(project)
749 issue2 = Issue.generate_for_project!(project)
749 issue2 = Issue.generate_for_project!(project)
750
750
751 # 2 is a dupe of 1
751 # 2 is a dupe of 1
752 IssueRelation.create(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
752 IssueRelation.create(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
753 # 2 is a dup of 1 but 1 is not a duplicate of 2
753 # 2 is a dup of 1 but 1 is not a duplicate of 2
754 assert !issue2.reload.duplicates.include?(issue1)
754 assert !issue2.reload.duplicates.include?(issue1)
755
755
756 # Closing issue 2
756 # Closing issue 2
757 issue2.init_journal(User.find(:first), "Closing issue2")
757 issue2.init_journal(User.find(:first), "Closing issue2")
758 issue2.status = IssueStatus.find :first, :conditions => {:is_closed => true}
758 issue2.status = IssueStatus.find :first, :conditions => {:is_closed => true}
759 assert issue2.save
759 assert issue2.save
760 # 1 should not be also closed
760 # 1 should not be also closed
761 assert !issue1.reload.closed?
761 assert !issue1.reload.closed?
762 end
762 end
763
763
764 def test_assignable_versions
764 def test_assignable_versions
765 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
765 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
766 assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq
766 assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq
767 end
767 end
768
768
769 def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version
769 def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version
770 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
770 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
771 assert !issue.save
771 assert !issue.save
772 assert_not_nil issue.errors[:fixed_version_id]
772 assert_not_nil issue.errors[:fixed_version_id]
773 end
773 end
774
774
775 def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version
775 def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version
776 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 2, :subject => 'New issue')
776 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 2, :subject => 'New issue')
777 assert !issue.save
777 assert !issue.save
778 assert_not_nil issue.errors[:fixed_version_id]
778 assert_not_nil issue.errors[:fixed_version_id]
779 end
779 end
780
780
781 def test_should_be_able_to_assign_a_new_issue_to_an_open_version
781 def test_should_be_able_to_assign_a_new_issue_to_an_open_version
782 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 3, :subject => 'New issue')
782 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 3, :subject => 'New issue')
783 assert issue.save
783 assert issue.save
784 end
784 end
785
785
786 def test_should_be_able_to_update_an_issue_assigned_to_a_closed_version
786 def test_should_be_able_to_update_an_issue_assigned_to_a_closed_version
787 issue = Issue.find(11)
787 issue = Issue.find(11)
788 assert_equal 'closed', issue.fixed_version.status
788 assert_equal 'closed', issue.fixed_version.status
789 issue.subject = 'Subject changed'
789 issue.subject = 'Subject changed'
790 assert issue.save
790 assert issue.save
791 end
791 end
792
792
793 def test_should_not_be_able_to_reopen_an_issue_assigned_to_a_closed_version
793 def test_should_not_be_able_to_reopen_an_issue_assigned_to_a_closed_version
794 issue = Issue.find(11)
794 issue = Issue.find(11)
795 issue.status_id = 1
795 issue.status_id = 1
796 assert !issue.save
796 assert !issue.save
797 assert_not_nil issue.errors[:base]
797 assert_not_nil issue.errors[:base]
798 end
798 end
799
799
800 def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version
800 def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version
801 issue = Issue.find(11)
801 issue = Issue.find(11)
802 issue.status_id = 1
802 issue.status_id = 1
803 issue.fixed_version_id = 3
803 issue.fixed_version_id = 3
804 assert issue.save
804 assert issue.save
805 end
805 end
806
806
807 def test_should_be_able_to_reopen_an_issue_assigned_to_a_locked_version
807 def test_should_be_able_to_reopen_an_issue_assigned_to_a_locked_version
808 issue = Issue.find(12)
808 issue = Issue.find(12)
809 assert_equal 'locked', issue.fixed_version.status
809 assert_equal 'locked', issue.fixed_version.status
810 issue.status_id = 1
810 issue.status_id = 1
811 assert issue.save
811 assert issue.save
812 end
812 end
813
813
814 def test_should_not_be_able_to_keep_unshared_version_when_changing_project
814 def test_should_not_be_able_to_keep_unshared_version_when_changing_project
815 issue = Issue.find(2)
815 issue = Issue.find(2)
816 assert_equal 2, issue.fixed_version_id
816 assert_equal 2, issue.fixed_version_id
817 issue.project_id = 3
817 issue.project_id = 3
818 assert_nil issue.fixed_version_id
818 assert_nil issue.fixed_version_id
819 issue.fixed_version_id = 2
819 issue.fixed_version_id = 2
820 assert !issue.save
820 assert !issue.save
821 assert_include 'Target version is not included in the list', issue.errors.full_messages
821 assert_include 'Target version is not included in the list', issue.errors.full_messages
822 end
822 end
823
823
824 def test_should_keep_shared_version_when_changing_project
824 def test_should_keep_shared_version_when_changing_project
825 Version.find(2).update_attribute :sharing, 'tree'
825 Version.find(2).update_attribute :sharing, 'tree'
826
826
827 issue = Issue.find(2)
827 issue = Issue.find(2)
828 assert_equal 2, issue.fixed_version_id
828 assert_equal 2, issue.fixed_version_id
829 issue.project_id = 3
829 issue.project_id = 3
830 assert_equal 2, issue.fixed_version_id
830 assert_equal 2, issue.fixed_version_id
831 assert issue.save
831 assert issue.save
832 end
832 end
833
833
834 def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled
834 def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled
835 assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
835 assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
836 end
836 end
837
837
838 def test_allowed_target_projects_on_move_should_not_include_projects_with_issue_tracking_disabled
838 def test_allowed_target_projects_on_move_should_not_include_projects_with_issue_tracking_disabled
839 Project.find(2).disable_module! :issue_tracking
839 Project.find(2).disable_module! :issue_tracking
840 assert_not_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
840 assert_not_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
841 end
841 end
842
842
843 def test_move_to_another_project_with_same_category
843 def test_move_to_another_project_with_same_category
844 issue = Issue.find(1)
844 issue = Issue.find(1)
845 issue.project = Project.find(2)
845 issue.project = Project.find(2)
846 assert issue.save
846 assert issue.save
847 issue.reload
847 issue.reload
848 assert_equal 2, issue.project_id
848 assert_equal 2, issue.project_id
849 # Category changes
849 # Category changes
850 assert_equal 4, issue.category_id
850 assert_equal 4, issue.category_id
851 # Make sure time entries were move to the target project
851 # Make sure time entries were move to the target project
852 assert_equal 2, issue.time_entries.first.project_id
852 assert_equal 2, issue.time_entries.first.project_id
853 end
853 end
854
854
855 def test_move_to_another_project_without_same_category
855 def test_move_to_another_project_without_same_category
856 issue = Issue.find(2)
856 issue = Issue.find(2)
857 issue.project = Project.find(2)
857 issue.project = Project.find(2)
858 assert issue.save
858 assert issue.save
859 issue.reload
859 issue.reload
860 assert_equal 2, issue.project_id
860 assert_equal 2, issue.project_id
861 # Category cleared
861 # Category cleared
862 assert_nil issue.category_id
862 assert_nil issue.category_id
863 end
863 end
864
864
865 def test_move_to_another_project_should_clear_fixed_version_when_not_shared
865 def test_move_to_another_project_should_clear_fixed_version_when_not_shared
866 issue = Issue.find(1)
866 issue = Issue.find(1)
867 issue.update_attribute(:fixed_version_id, 1)
867 issue.update_attribute(:fixed_version_id, 1)
868 issue.project = Project.find(2)
868 issue.project = Project.find(2)
869 assert issue.save
869 assert issue.save
870 issue.reload
870 issue.reload
871 assert_equal 2, issue.project_id
871 assert_equal 2, issue.project_id
872 # Cleared fixed_version
872 # Cleared fixed_version
873 assert_equal nil, issue.fixed_version
873 assert_equal nil, issue.fixed_version
874 end
874 end
875
875
876 def test_move_to_another_project_should_keep_fixed_version_when_shared_with_the_target_project
876 def test_move_to_another_project_should_keep_fixed_version_when_shared_with_the_target_project
877 issue = Issue.find(1)
877 issue = Issue.find(1)
878 issue.update_attribute(:fixed_version_id, 4)
878 issue.update_attribute(:fixed_version_id, 4)
879 issue.project = Project.find(5)
879 issue.project = Project.find(5)
880 assert issue.save
880 assert issue.save
881 issue.reload
881 issue.reload
882 assert_equal 5, issue.project_id
882 assert_equal 5, issue.project_id
883 # Keep fixed_version
883 # Keep fixed_version
884 assert_equal 4, issue.fixed_version_id
884 assert_equal 4, issue.fixed_version_id
885 end
885 end
886
886
887 def test_move_to_another_project_should_clear_fixed_version_when_not_shared_with_the_target_project
887 def test_move_to_another_project_should_clear_fixed_version_when_not_shared_with_the_target_project
888 issue = Issue.find(1)
888 issue = Issue.find(1)
889 issue.update_attribute(:fixed_version_id, 1)
889 issue.update_attribute(:fixed_version_id, 1)
890 issue.project = Project.find(5)
890 issue.project = Project.find(5)
891 assert issue.save
891 assert issue.save
892 issue.reload
892 issue.reload
893 assert_equal 5, issue.project_id
893 assert_equal 5, issue.project_id
894 # Cleared fixed_version
894 # Cleared fixed_version
895 assert_equal nil, issue.fixed_version
895 assert_equal nil, issue.fixed_version
896 end
896 end
897
897
898 def test_move_to_another_project_should_keep_fixed_version_when_shared_systemwide
898 def test_move_to_another_project_should_keep_fixed_version_when_shared_systemwide
899 issue = Issue.find(1)
899 issue = Issue.find(1)
900 issue.update_attribute(:fixed_version_id, 7)
900 issue.update_attribute(:fixed_version_id, 7)
901 issue.project = Project.find(2)
901 issue.project = Project.find(2)
902 assert issue.save
902 assert issue.save
903 issue.reload
903 issue.reload
904 assert_equal 2, issue.project_id
904 assert_equal 2, issue.project_id
905 # Keep fixed_version
905 # Keep fixed_version
906 assert_equal 7, issue.fixed_version_id
906 assert_equal 7, issue.fixed_version_id
907 end
907 end
908
908
909 def test_move_to_another_project_should_keep_parent_if_valid
910 issue = Issue.find(1)
911 issue.update_attribute(:parent_issue_id, 2)
912 issue.project = Project.find(3)
913 assert issue.save
914 issue.reload
915 assert_equal 2, issue.parent_id
916 end
917
918 def test_move_to_another_project_should_clear_parent_if_not_valid
919 issue = Issue.find(1)
920 issue.update_attribute(:parent_issue_id, 2)
921 issue.project = Project.find(2)
922 assert issue.save
923 issue.reload
924 assert_nil issue.parent_id
925 end
926
909 def test_move_to_another_project_with_disabled_tracker
927 def test_move_to_another_project_with_disabled_tracker
910 issue = Issue.find(1)
928 issue = Issue.find(1)
911 target = Project.find(2)
929 target = Project.find(2)
912 target.tracker_ids = [3]
930 target.tracker_ids = [3]
913 target.save
931 target.save
914 issue.project = target
932 issue.project = target
915 assert issue.save
933 assert issue.save
916 issue.reload
934 issue.reload
917 assert_equal 2, issue.project_id
935 assert_equal 2, issue.project_id
918 assert_equal 3, issue.tracker_id
936 assert_equal 3, issue.tracker_id
919 end
937 end
920
938
921 def test_copy_to_the_same_project
939 def test_copy_to_the_same_project
922 issue = Issue.find(1)
940 issue = Issue.find(1)
923 copy = issue.copy
941 copy = issue.copy
924 assert_difference 'Issue.count' do
942 assert_difference 'Issue.count' do
925 copy.save!
943 copy.save!
926 end
944 end
927 assert_kind_of Issue, copy
945 assert_kind_of Issue, copy
928 assert_equal issue.project, copy.project
946 assert_equal issue.project, copy.project
929 assert_equal "125", copy.custom_value_for(2).value
947 assert_equal "125", copy.custom_value_for(2).value
930 end
948 end
931
949
932 def test_copy_to_another_project_and_tracker
950 def test_copy_to_another_project_and_tracker
933 issue = Issue.find(1)
951 issue = Issue.find(1)
934 copy = issue.copy(:project_id => 3, :tracker_id => 2)
952 copy = issue.copy(:project_id => 3, :tracker_id => 2)
935 assert_difference 'Issue.count' do
953 assert_difference 'Issue.count' do
936 copy.save!
954 copy.save!
937 end
955 end
938 copy.reload
956 copy.reload
939 assert_kind_of Issue, copy
957 assert_kind_of Issue, copy
940 assert_equal Project.find(3), copy.project
958 assert_equal Project.find(3), copy.project
941 assert_equal Tracker.find(2), copy.tracker
959 assert_equal Tracker.find(2), copy.tracker
942 # Custom field #2 is not associated with target tracker
960 # Custom field #2 is not associated with target tracker
943 assert_nil copy.custom_value_for(2)
961 assert_nil copy.custom_value_for(2)
944 end
962 end
945
963
946 context "#copy" do
964 context "#copy" do
947 setup do
965 setup do
948 @issue = Issue.find(1)
966 @issue = Issue.find(1)
949 end
967 end
950
968
951 should "not create a journal" do
969 should "not create a journal" do
952 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
970 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
953 copy.save!
971 copy.save!
954 assert_equal 0, copy.reload.journals.size
972 assert_equal 0, copy.reload.journals.size
955 end
973 end
956
974
957 should "allow assigned_to changes" do
975 should "allow assigned_to changes" do
958 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
976 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
959 assert_equal 3, copy.assigned_to_id
977 assert_equal 3, copy.assigned_to_id
960 end
978 end
961
979
962 should "allow status changes" do
980 should "allow status changes" do
963 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :status_id => 2)
981 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :status_id => 2)
964 assert_equal 2, copy.status_id
982 assert_equal 2, copy.status_id
965 end
983 end
966
984
967 should "allow start date changes" do
985 should "allow start date changes" do
968 date = Date.today
986 date = Date.today
969 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
987 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
970 assert_equal date, copy.start_date
988 assert_equal date, copy.start_date
971 end
989 end
972
990
973 should "allow due date changes" do
991 should "allow due date changes" do
974 date = Date.today
992 date = Date.today
975 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :due_date => date)
993 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :due_date => date)
976 assert_equal date, copy.due_date
994 assert_equal date, copy.due_date
977 end
995 end
978
996
979 should "set current user as author" do
997 should "set current user as author" do
980 User.current = User.find(9)
998 User.current = User.find(9)
981 copy = @issue.copy(:project_id => 3, :tracker_id => 2)
999 copy = @issue.copy(:project_id => 3, :tracker_id => 2)
982 assert_equal User.current, copy.author
1000 assert_equal User.current, copy.author
983 end
1001 end
984
1002
985 should "create a journal with notes" do
1003 should "create a journal with notes" do
986 date = Date.today
1004 date = Date.today
987 notes = "Notes added when copying"
1005 notes = "Notes added when copying"
988 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
1006 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
989 copy.init_journal(User.current, notes)
1007 copy.init_journal(User.current, notes)
990 copy.save!
1008 copy.save!
991
1009
992 assert_equal 1, copy.journals.size
1010 assert_equal 1, copy.journals.size
993 journal = copy.journals.first
1011 journal = copy.journals.first
994 assert_equal 0, journal.details.size
1012 assert_equal 0, journal.details.size
995 assert_equal notes, journal.notes
1013 assert_equal notes, journal.notes
996 end
1014 end
997 end
1015 end
998
1016
1017 def test_valid_parent_project
1018 issue = Issue.find(1)
1019 issue_in_same_project = Issue.find(2)
1020 issue_in_child_project = Issue.find(5)
1021 issue_in_grandchild_project = Issue.generate!(:project_id => 6, :tracker_id => 1)
1022 issue_in_other_child_project = Issue.find(6)
1023 issue_in_different_tree = Issue.find(4)
1024
1025 with_settings :cross_project_subtasks => '' do
1026 assert_equal true, issue.valid_parent_project?(issue_in_same_project)
1027 assert_equal false, issue.valid_parent_project?(issue_in_child_project)
1028 assert_equal false, issue.valid_parent_project?(issue_in_grandchild_project)
1029 assert_equal false, issue.valid_parent_project?(issue_in_different_tree)
1030 end
1031
1032 with_settings :cross_project_subtasks => 'system' do
1033 assert_equal true, issue.valid_parent_project?(issue_in_same_project)
1034 assert_equal true, issue.valid_parent_project?(issue_in_child_project)
1035 assert_equal true, issue.valid_parent_project?(issue_in_different_tree)
1036 end
1037
1038 with_settings :cross_project_subtasks => 'tree' do
1039 assert_equal true, issue.valid_parent_project?(issue_in_same_project)
1040 assert_equal true, issue.valid_parent_project?(issue_in_child_project)
1041 assert_equal true, issue.valid_parent_project?(issue_in_grandchild_project)
1042 assert_equal false, issue.valid_parent_project?(issue_in_different_tree)
1043
1044 assert_equal true, issue_in_child_project.valid_parent_project?(issue_in_same_project)
1045 assert_equal true, issue_in_child_project.valid_parent_project?(issue_in_other_child_project)
1046 end
1047
1048 with_settings :cross_project_subtasks => 'descendants' do
1049 assert_equal true, issue.valid_parent_project?(issue_in_same_project)
1050 assert_equal false, issue.valid_parent_project?(issue_in_child_project)
1051 assert_equal false, issue.valid_parent_project?(issue_in_grandchild_project)
1052 assert_equal false, issue.valid_parent_project?(issue_in_different_tree)
1053
1054 assert_equal true, issue_in_child_project.valid_parent_project?(issue)
1055 assert_equal false, issue_in_child_project.valid_parent_project?(issue_in_other_child_project)
1056 end
1057 end
1058
999 def test_recipients_should_include_previous_assignee
1059 def test_recipients_should_include_previous_assignee
1000 user = User.find(3)
1060 user = User.find(3)
1001 user.members.update_all ["mail_notification = ?", false]
1061 user.members.update_all ["mail_notification = ?", false]
1002 user.update_attribute :mail_notification, 'only_assigned'
1062 user.update_attribute :mail_notification, 'only_assigned'
1003
1063
1004 issue = Issue.find(2)
1064 issue = Issue.find(2)
1005 issue.assigned_to = nil
1065 issue.assigned_to = nil
1006 assert_include user.mail, issue.recipients
1066 assert_include user.mail, issue.recipients
1007 issue.save!
1067 issue.save!
1008 assert !issue.recipients.include?(user.mail)
1068 assert !issue.recipients.include?(user.mail)
1009 end
1069 end
1010
1070
1011 def test_recipients_should_not_include_users_that_cannot_view_the_issue
1071 def test_recipients_should_not_include_users_that_cannot_view_the_issue
1012 issue = Issue.find(12)
1072 issue = Issue.find(12)
1013 assert issue.recipients.include?(issue.author.mail)
1073 assert issue.recipients.include?(issue.author.mail)
1014 # copy the issue to a private project
1074 # copy the issue to a private project
1015 copy = issue.copy(:project_id => 5, :tracker_id => 2)
1075 copy = issue.copy(:project_id => 5, :tracker_id => 2)
1016 # author is not a member of project anymore
1076 # author is not a member of project anymore
1017 assert !copy.recipients.include?(copy.author.mail)
1077 assert !copy.recipients.include?(copy.author.mail)
1018 end
1078 end
1019
1079
1020 def test_recipients_should_include_the_assigned_group_members
1080 def test_recipients_should_include_the_assigned_group_members
1021 group_member = User.generate!
1081 group_member = User.generate!
1022 group = Group.generate!
1082 group = Group.generate!
1023 group.users << group_member
1083 group.users << group_member
1024
1084
1025 issue = Issue.find(12)
1085 issue = Issue.find(12)
1026 issue.assigned_to = group
1086 issue.assigned_to = group
1027 assert issue.recipients.include?(group_member.mail)
1087 assert issue.recipients.include?(group_member.mail)
1028 end
1088 end
1029
1089
1030 def test_watcher_recipients_should_not_include_users_that_cannot_view_the_issue
1090 def test_watcher_recipients_should_not_include_users_that_cannot_view_the_issue
1031 user = User.find(3)
1091 user = User.find(3)
1032 issue = Issue.find(9)
1092 issue = Issue.find(9)
1033 Watcher.create!(:user => user, :watchable => issue)
1093 Watcher.create!(:user => user, :watchable => issue)
1034 assert issue.watched_by?(user)
1094 assert issue.watched_by?(user)
1035 assert !issue.watcher_recipients.include?(user.mail)
1095 assert !issue.watcher_recipients.include?(user.mail)
1036 end
1096 end
1037
1097
1038 def test_issue_destroy
1098 def test_issue_destroy
1039 Issue.find(1).destroy
1099 Issue.find(1).destroy
1040 assert_nil Issue.find_by_id(1)
1100 assert_nil Issue.find_by_id(1)
1041 assert_nil TimeEntry.find_by_issue_id(1)
1101 assert_nil TimeEntry.find_by_issue_id(1)
1042 end
1102 end
1043
1103
1044 def test_destroying_a_deleted_issue_should_not_raise_an_error
1104 def test_destroying_a_deleted_issue_should_not_raise_an_error
1045 issue = Issue.find(1)
1105 issue = Issue.find(1)
1046 Issue.find(1).destroy
1106 Issue.find(1).destroy
1047
1107
1048 assert_nothing_raised do
1108 assert_nothing_raised do
1049 assert_no_difference 'Issue.count' do
1109 assert_no_difference 'Issue.count' do
1050 issue.destroy
1110 issue.destroy
1051 end
1111 end
1052 assert issue.destroyed?
1112 assert issue.destroyed?
1053 end
1113 end
1054 end
1114 end
1055
1115
1056 def test_destroying_a_stale_issue_should_not_raise_an_error
1116 def test_destroying_a_stale_issue_should_not_raise_an_error
1057 issue = Issue.find(1)
1117 issue = Issue.find(1)
1058 Issue.find(1).update_attribute :subject, "Updated"
1118 Issue.find(1).update_attribute :subject, "Updated"
1059
1119
1060 assert_nothing_raised do
1120 assert_nothing_raised do
1061 assert_difference 'Issue.count', -1 do
1121 assert_difference 'Issue.count', -1 do
1062 issue.destroy
1122 issue.destroy
1063 end
1123 end
1064 assert issue.destroyed?
1124 assert issue.destroyed?
1065 end
1125 end
1066 end
1126 end
1067
1127
1068 def test_blocked
1128 def test_blocked
1069 blocked_issue = Issue.find(9)
1129 blocked_issue = Issue.find(9)
1070 blocking_issue = Issue.find(10)
1130 blocking_issue = Issue.find(10)
1071
1131
1072 assert blocked_issue.blocked?
1132 assert blocked_issue.blocked?
1073 assert !blocking_issue.blocked?
1133 assert !blocking_issue.blocked?
1074 end
1134 end
1075
1135
1076 def test_blocked_issues_dont_allow_closed_statuses
1136 def test_blocked_issues_dont_allow_closed_statuses
1077 blocked_issue = Issue.find(9)
1137 blocked_issue = Issue.find(9)
1078
1138
1079 allowed_statuses = blocked_issue.new_statuses_allowed_to(users(:users_002))
1139 allowed_statuses = blocked_issue.new_statuses_allowed_to(users(:users_002))
1080 assert !allowed_statuses.empty?
1140 assert !allowed_statuses.empty?
1081 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1141 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1082 assert closed_statuses.empty?
1142 assert closed_statuses.empty?
1083 end
1143 end
1084
1144
1085 def test_unblocked_issues_allow_closed_statuses
1145 def test_unblocked_issues_allow_closed_statuses
1086 blocking_issue = Issue.find(10)
1146 blocking_issue = Issue.find(10)
1087
1147
1088 allowed_statuses = blocking_issue.new_statuses_allowed_to(users(:users_002))
1148 allowed_statuses = blocking_issue.new_statuses_allowed_to(users(:users_002))
1089 assert !allowed_statuses.empty?
1149 assert !allowed_statuses.empty?
1090 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1150 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1091 assert !closed_statuses.empty?
1151 assert !closed_statuses.empty?
1092 end
1152 end
1093
1153
1094 def test_rescheduling_an_issue_should_reschedule_following_issue
1154 def test_rescheduling_an_issue_should_reschedule_following_issue
1095 issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1155 issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1096 issue2 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1156 issue2 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1097 IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
1157 IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
1098 assert_equal issue1.due_date + 1, issue2.reload.start_date
1158 assert_equal issue1.due_date + 1, issue2.reload.start_date
1099
1159
1100 issue1.due_date = Date.today + 5
1160 issue1.due_date = Date.today + 5
1101 issue1.save!
1161 issue1.save!
1102 assert_equal issue1.due_date + 1, issue2.reload.start_date
1162 assert_equal issue1.due_date + 1, issue2.reload.start_date
1103 end
1163 end
1104
1164
1105 def test_rescheduling_a_stale_issue_should_not_raise_an_error
1165 def test_rescheduling_a_stale_issue_should_not_raise_an_error
1106 stale = Issue.find(1)
1166 stale = Issue.find(1)
1107 issue = Issue.find(1)
1167 issue = Issue.find(1)
1108 issue.subject = "Updated"
1168 issue.subject = "Updated"
1109 issue.save!
1169 issue.save!
1110
1170
1111 date = 10.days.from_now.to_date
1171 date = 10.days.from_now.to_date
1112 assert_nothing_raised do
1172 assert_nothing_raised do
1113 stale.reschedule_after(date)
1173 stale.reschedule_after(date)
1114 end
1174 end
1115 assert_equal date, stale.reload.start_date
1175 assert_equal date, stale.reload.start_date
1116 end
1176 end
1117
1177
1118 def test_overdue
1178 def test_overdue
1119 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
1179 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
1120 assert !Issue.new(:due_date => Date.today).overdue?
1180 assert !Issue.new(:due_date => Date.today).overdue?
1121 assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
1181 assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
1122 assert !Issue.new(:due_date => nil).overdue?
1182 assert !Issue.new(:due_date => nil).overdue?
1123 assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
1183 assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
1124 end
1184 end
1125
1185
1126 context "#behind_schedule?" do
1186 context "#behind_schedule?" do
1127 should "be false if the issue has no start_date" do
1187 should "be false if the issue has no start_date" do
1128 assert !Issue.new(:start_date => nil, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1188 assert !Issue.new(:start_date => nil, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1129 end
1189 end
1130
1190
1131 should "be false if the issue has no end_date" do
1191 should "be false if the issue has no end_date" do
1132 assert !Issue.new(:start_date => 1.day.from_now.to_date, :due_date => nil, :done_ratio => 0).behind_schedule?
1192 assert !Issue.new(:start_date => 1.day.from_now.to_date, :due_date => nil, :done_ratio => 0).behind_schedule?
1133 end
1193 end
1134
1194
1135 should "be false if the issue has more done than it's calendar time" do
1195 should "be false if the issue has more done than it's calendar time" do
1136 assert !Issue.new(:start_date => 50.days.ago.to_date, :due_date => 50.days.from_now.to_date, :done_ratio => 90).behind_schedule?
1196 assert !Issue.new(:start_date => 50.days.ago.to_date, :due_date => 50.days.from_now.to_date, :done_ratio => 90).behind_schedule?
1137 end
1197 end
1138
1198
1139 should "be true if the issue hasn't been started at all" do
1199 should "be true if the issue hasn't been started at all" do
1140 assert Issue.new(:start_date => 1.day.ago.to_date, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1200 assert Issue.new(:start_date => 1.day.ago.to_date, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1141 end
1201 end
1142
1202
1143 should "be true if the issue has used more calendar time than it's done ratio" do
1203 should "be true if the issue has used more calendar time than it's done ratio" do
1144 assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
1204 assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
1145 end
1205 end
1146 end
1206 end
1147
1207
1148 context "#assignable_users" do
1208 context "#assignable_users" do
1149 should "be Users" do
1209 should "be Users" do
1150 assert_kind_of User, Issue.find(1).assignable_users.first
1210 assert_kind_of User, Issue.find(1).assignable_users.first
1151 end
1211 end
1152
1212
1153 should "include the issue author" do
1213 should "include the issue author" do
1154 project = Project.find(1)
1214 project = Project.find(1)
1155 non_project_member = User.generate!
1215 non_project_member = User.generate!
1156 issue = Issue.generate_for_project!(project, :author => non_project_member)
1216 issue = Issue.generate_for_project!(project, :author => non_project_member)
1157
1217
1158 assert issue.assignable_users.include?(non_project_member)
1218 assert issue.assignable_users.include?(non_project_member)
1159 end
1219 end
1160
1220
1161 should "include the current assignee" do
1221 should "include the current assignee" do
1162 project = Project.find(1)
1222 project = Project.find(1)
1163 user = User.generate!
1223 user = User.generate!
1164 issue = Issue.generate_for_project!(project, :assigned_to => user)
1224 issue = Issue.generate_for_project!(project, :assigned_to => user)
1165 user.lock!
1225 user.lock!
1166
1226
1167 assert Issue.find(issue.id).assignable_users.include?(user)
1227 assert Issue.find(issue.id).assignable_users.include?(user)
1168 end
1228 end
1169
1229
1170 should "not show the issue author twice" do
1230 should "not show the issue author twice" do
1171 assignable_user_ids = Issue.find(1).assignable_users.collect(&:id)
1231 assignable_user_ids = Issue.find(1).assignable_users.collect(&:id)
1172 assert_equal 2, assignable_user_ids.length
1232 assert_equal 2, assignable_user_ids.length
1173
1233
1174 assignable_user_ids.each do |user_id|
1234 assignable_user_ids.each do |user_id|
1175 assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once"
1235 assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once"
1176 end
1236 end
1177 end
1237 end
1178
1238
1179 context "with issue_group_assignment" do
1239 context "with issue_group_assignment" do
1180 should "include groups" do
1240 should "include groups" do
1181 issue = Issue.new(:project => Project.find(2))
1241 issue = Issue.new(:project => Project.find(2))
1182
1242
1183 with_settings :issue_group_assignment => '1' do
1243 with_settings :issue_group_assignment => '1' do
1184 assert_equal %w(Group User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1244 assert_equal %w(Group User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1185 assert issue.assignable_users.include?(Group.find(11))
1245 assert issue.assignable_users.include?(Group.find(11))
1186 end
1246 end
1187 end
1247 end
1188 end
1248 end
1189
1249
1190 context "without issue_group_assignment" do
1250 context "without issue_group_assignment" do
1191 should "not include groups" do
1251 should "not include groups" do
1192 issue = Issue.new(:project => Project.find(2))
1252 issue = Issue.new(:project => Project.find(2))
1193
1253
1194 with_settings :issue_group_assignment => '0' do
1254 with_settings :issue_group_assignment => '0' do
1195 assert_equal %w(User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1255 assert_equal %w(User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1196 assert !issue.assignable_users.include?(Group.find(11))
1256 assert !issue.assignable_users.include?(Group.find(11))
1197 end
1257 end
1198 end
1258 end
1199 end
1259 end
1200 end
1260 end
1201
1261
1202 def test_create_should_send_email_notification
1262 def test_create_should_send_email_notification
1203 ActionMailer::Base.deliveries.clear
1263 ActionMailer::Base.deliveries.clear
1204 issue = Issue.new(:project_id => 1, :tracker_id => 1,
1264 issue = Issue.new(:project_id => 1, :tracker_id => 1,
1205 :author_id => 3, :status_id => 1,
1265 :author_id => 3, :status_id => 1,
1206 :priority => IssuePriority.all.first,
1266 :priority => IssuePriority.all.first,
1207 :subject => 'test_create', :estimated_hours => '1:30')
1267 :subject => 'test_create', :estimated_hours => '1:30')
1208
1268
1209 assert issue.save
1269 assert issue.save
1210 assert_equal 1, ActionMailer::Base.deliveries.size
1270 assert_equal 1, ActionMailer::Base.deliveries.size
1211 end
1271 end
1212
1272
1213 def test_stale_issue_should_not_send_email_notification
1273 def test_stale_issue_should_not_send_email_notification
1214 ActionMailer::Base.deliveries.clear
1274 ActionMailer::Base.deliveries.clear
1215 issue = Issue.find(1)
1275 issue = Issue.find(1)
1216 stale = Issue.find(1)
1276 stale = Issue.find(1)
1217
1277
1218 issue.init_journal(User.find(1))
1278 issue.init_journal(User.find(1))
1219 issue.subject = 'Subjet update'
1279 issue.subject = 'Subjet update'
1220 assert issue.save
1280 assert issue.save
1221 assert_equal 1, ActionMailer::Base.deliveries.size
1281 assert_equal 1, ActionMailer::Base.deliveries.size
1222 ActionMailer::Base.deliveries.clear
1282 ActionMailer::Base.deliveries.clear
1223
1283
1224 stale.init_journal(User.find(1))
1284 stale.init_journal(User.find(1))
1225 stale.subject = 'Another subjet update'
1285 stale.subject = 'Another subjet update'
1226 assert_raise ActiveRecord::StaleObjectError do
1286 assert_raise ActiveRecord::StaleObjectError do
1227 stale.save
1287 stale.save
1228 end
1288 end
1229 assert ActionMailer::Base.deliveries.empty?
1289 assert ActionMailer::Base.deliveries.empty?
1230 end
1290 end
1231
1291
1232 def test_journalized_description
1292 def test_journalized_description
1233 IssueCustomField.delete_all
1293 IssueCustomField.delete_all
1234
1294
1235 i = Issue.first
1295 i = Issue.first
1236 old_description = i.description
1296 old_description = i.description
1237 new_description = "This is the new description"
1297 new_description = "This is the new description"
1238
1298
1239 i.init_journal(User.find(2))
1299 i.init_journal(User.find(2))
1240 i.description = new_description
1300 i.description = new_description
1241 assert_difference 'Journal.count', 1 do
1301 assert_difference 'Journal.count', 1 do
1242 assert_difference 'JournalDetail.count', 1 do
1302 assert_difference 'JournalDetail.count', 1 do
1243 i.save!
1303 i.save!
1244 end
1304 end
1245 end
1305 end
1246
1306
1247 detail = JournalDetail.first(:order => 'id DESC')
1307 detail = JournalDetail.first(:order => 'id DESC')
1248 assert_equal i, detail.journal.journalized
1308 assert_equal i, detail.journal.journalized
1249 assert_equal 'attr', detail.property
1309 assert_equal 'attr', detail.property
1250 assert_equal 'description', detail.prop_key
1310 assert_equal 'description', detail.prop_key
1251 assert_equal old_description, detail.old_value
1311 assert_equal old_description, detail.old_value
1252 assert_equal new_description, detail.value
1312 assert_equal new_description, detail.value
1253 end
1313 end
1254
1314
1255 def test_blank_descriptions_should_not_be_journalized
1315 def test_blank_descriptions_should_not_be_journalized
1256 IssueCustomField.delete_all
1316 IssueCustomField.delete_all
1257 Issue.update_all("description = NULL", "id=1")
1317 Issue.update_all("description = NULL", "id=1")
1258
1318
1259 i = Issue.find(1)
1319 i = Issue.find(1)
1260 i.init_journal(User.find(2))
1320 i.init_journal(User.find(2))
1261 i.subject = "blank description"
1321 i.subject = "blank description"
1262 i.description = "\r\n"
1322 i.description = "\r\n"
1263
1323
1264 assert_difference 'Journal.count', 1 do
1324 assert_difference 'Journal.count', 1 do
1265 assert_difference 'JournalDetail.count', 1 do
1325 assert_difference 'JournalDetail.count', 1 do
1266 i.save!
1326 i.save!
1267 end
1327 end
1268 end
1328 end
1269 end
1329 end
1270
1330
1271 def test_journalized_multi_custom_field
1331 def test_journalized_multi_custom_field
1272 field = IssueCustomField.create!(:name => 'filter', :field_format => 'list', :is_filter => true, :is_for_all => true,
1332 field = IssueCustomField.create!(:name => 'filter', :field_format => 'list', :is_filter => true, :is_for_all => true,
1273 :tracker_ids => [1], :possible_values => ['value1', 'value2', 'value3'], :multiple => true)
1333 :tracker_ids => [1], :possible_values => ['value1', 'value2', 'value3'], :multiple => true)
1274
1334
1275 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'Test', :author_id => 1)
1335 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'Test', :author_id => 1)
1276
1336
1277 assert_difference 'Journal.count' do
1337 assert_difference 'Journal.count' do
1278 assert_difference 'JournalDetail.count' do
1338 assert_difference 'JournalDetail.count' do
1279 issue.init_journal(User.first)
1339 issue.init_journal(User.first)
1280 issue.custom_field_values = {field.id => ['value1']}
1340 issue.custom_field_values = {field.id => ['value1']}
1281 issue.save!
1341 issue.save!
1282 end
1342 end
1283 assert_difference 'JournalDetail.count' do
1343 assert_difference 'JournalDetail.count' do
1284 issue.init_journal(User.first)
1344 issue.init_journal(User.first)
1285 issue.custom_field_values = {field.id => ['value1', 'value2']}
1345 issue.custom_field_values = {field.id => ['value1', 'value2']}
1286 issue.save!
1346 issue.save!
1287 end
1347 end
1288 assert_difference 'JournalDetail.count', 2 do
1348 assert_difference 'JournalDetail.count', 2 do
1289 issue.init_journal(User.first)
1349 issue.init_journal(User.first)
1290 issue.custom_field_values = {field.id => ['value3', 'value2']}
1350 issue.custom_field_values = {field.id => ['value3', 'value2']}
1291 issue.save!
1351 issue.save!
1292 end
1352 end
1293 assert_difference 'JournalDetail.count', 2 do
1353 assert_difference 'JournalDetail.count', 2 do
1294 issue.init_journal(User.first)
1354 issue.init_journal(User.first)
1295 issue.custom_field_values = {field.id => nil}
1355 issue.custom_field_values = {field.id => nil}
1296 issue.save!
1356 issue.save!
1297 end
1357 end
1298 end
1358 end
1299 end
1359 end
1300
1360
1301 def test_description_eol_should_be_normalized
1361 def test_description_eol_should_be_normalized
1302 i = Issue.new(:description => "CR \r LF \n CRLF \r\n")
1362 i = Issue.new(:description => "CR \r LF \n CRLF \r\n")
1303 assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description
1363 assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description
1304 end
1364 end
1305
1365
1306 def test_saving_twice_should_not_duplicate_journal_details
1366 def test_saving_twice_should_not_duplicate_journal_details
1307 i = Issue.find(:first)
1367 i = Issue.find(:first)
1308 i.init_journal(User.find(2), 'Some notes')
1368 i.init_journal(User.find(2), 'Some notes')
1309 # initial changes
1369 # initial changes
1310 i.subject = 'New subject'
1370 i.subject = 'New subject'
1311 i.done_ratio = i.done_ratio + 10
1371 i.done_ratio = i.done_ratio + 10
1312 assert_difference 'Journal.count' do
1372 assert_difference 'Journal.count' do
1313 assert i.save
1373 assert i.save
1314 end
1374 end
1315 # 1 more change
1375 # 1 more change
1316 i.priority = IssuePriority.find(:first, :conditions => ["id <> ?", i.priority_id])
1376 i.priority = IssuePriority.find(:first, :conditions => ["id <> ?", i.priority_id])
1317 assert_no_difference 'Journal.count' do
1377 assert_no_difference 'Journal.count' do
1318 assert_difference 'JournalDetail.count', 1 do
1378 assert_difference 'JournalDetail.count', 1 do
1319 i.save
1379 i.save
1320 end
1380 end
1321 end
1381 end
1322 # no more change
1382 # no more change
1323 assert_no_difference 'Journal.count' do
1383 assert_no_difference 'Journal.count' do
1324 assert_no_difference 'JournalDetail.count' do
1384 assert_no_difference 'JournalDetail.count' do
1325 i.save
1385 i.save
1326 end
1386 end
1327 end
1387 end
1328 end
1388 end
1329
1389
1330 def test_all_dependent_issues
1390 def test_all_dependent_issues
1331 IssueRelation.delete_all
1391 IssueRelation.delete_all
1332 assert IssueRelation.create!(:issue_from => Issue.find(1),
1392 assert IssueRelation.create!(:issue_from => Issue.find(1),
1333 :issue_to => Issue.find(2),
1393 :issue_to => Issue.find(2),
1334 :relation_type => IssueRelation::TYPE_PRECEDES)
1394 :relation_type => IssueRelation::TYPE_PRECEDES)
1335 assert IssueRelation.create!(:issue_from => Issue.find(2),
1395 assert IssueRelation.create!(:issue_from => Issue.find(2),
1336 :issue_to => Issue.find(3),
1396 :issue_to => Issue.find(3),
1337 :relation_type => IssueRelation::TYPE_PRECEDES)
1397 :relation_type => IssueRelation::TYPE_PRECEDES)
1338 assert IssueRelation.create!(:issue_from => Issue.find(3),
1398 assert IssueRelation.create!(:issue_from => Issue.find(3),
1339 :issue_to => Issue.find(8),
1399 :issue_to => Issue.find(8),
1340 :relation_type => IssueRelation::TYPE_PRECEDES)
1400 :relation_type => IssueRelation::TYPE_PRECEDES)
1341
1401
1342 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1402 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1343 end
1403 end
1344
1404
1345 def test_all_dependent_issues_with_persistent_circular_dependency
1405 def test_all_dependent_issues_with_persistent_circular_dependency
1346 IssueRelation.delete_all
1406 IssueRelation.delete_all
1347 assert IssueRelation.create!(:issue_from => Issue.find(1),
1407 assert IssueRelation.create!(:issue_from => Issue.find(1),
1348 :issue_to => Issue.find(2),
1408 :issue_to => Issue.find(2),
1349 :relation_type => IssueRelation::TYPE_PRECEDES)
1409 :relation_type => IssueRelation::TYPE_PRECEDES)
1350 assert IssueRelation.create!(:issue_from => Issue.find(2),
1410 assert IssueRelation.create!(:issue_from => Issue.find(2),
1351 :issue_to => Issue.find(3),
1411 :issue_to => Issue.find(3),
1352 :relation_type => IssueRelation::TYPE_PRECEDES)
1412 :relation_type => IssueRelation::TYPE_PRECEDES)
1353
1413
1354 r = IssueRelation.create!(:issue_from => Issue.find(3),
1414 r = IssueRelation.create!(:issue_from => Issue.find(3),
1355 :issue_to => Issue.find(7),
1415 :issue_to => Issue.find(7),
1356 :relation_type => IssueRelation::TYPE_PRECEDES)
1416 :relation_type => IssueRelation::TYPE_PRECEDES)
1357 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1417 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1358
1418
1359 assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
1419 assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
1360 end
1420 end
1361
1421
1362 def test_all_dependent_issues_with_persistent_multiple_circular_dependencies
1422 def test_all_dependent_issues_with_persistent_multiple_circular_dependencies
1363 IssueRelation.delete_all
1423 IssueRelation.delete_all
1364 assert IssueRelation.create!(:issue_from => Issue.find(1),
1424 assert IssueRelation.create!(:issue_from => Issue.find(1),
1365 :issue_to => Issue.find(2),
1425 :issue_to => Issue.find(2),
1366 :relation_type => IssueRelation::TYPE_RELATES)
1426 :relation_type => IssueRelation::TYPE_RELATES)
1367 assert IssueRelation.create!(:issue_from => Issue.find(2),
1427 assert IssueRelation.create!(:issue_from => Issue.find(2),
1368 :issue_to => Issue.find(3),
1428 :issue_to => Issue.find(3),
1369 :relation_type => IssueRelation::TYPE_RELATES)
1429 :relation_type => IssueRelation::TYPE_RELATES)
1370 assert IssueRelation.create!(:issue_from => Issue.find(3),
1430 assert IssueRelation.create!(:issue_from => Issue.find(3),
1371 :issue_to => Issue.find(8),
1431 :issue_to => Issue.find(8),
1372 :relation_type => IssueRelation::TYPE_RELATES)
1432 :relation_type => IssueRelation::TYPE_RELATES)
1373
1433
1374 r = IssueRelation.create!(:issue_from => Issue.find(8),
1434 r = IssueRelation.create!(:issue_from => Issue.find(8),
1375 :issue_to => Issue.find(7),
1435 :issue_to => Issue.find(7),
1376 :relation_type => IssueRelation::TYPE_RELATES)
1436 :relation_type => IssueRelation::TYPE_RELATES)
1377 IssueRelation.update_all("issue_to_id = 2", ["id = ?", r.id])
1437 IssueRelation.update_all("issue_to_id = 2", ["id = ?", r.id])
1378
1438
1379 r = IssueRelation.create!(:issue_from => Issue.find(3),
1439 r = IssueRelation.create!(:issue_from => Issue.find(3),
1380 :issue_to => Issue.find(7),
1440 :issue_to => Issue.find(7),
1381 :relation_type => IssueRelation::TYPE_RELATES)
1441 :relation_type => IssueRelation::TYPE_RELATES)
1382 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1442 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1383
1443
1384 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1444 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1385 end
1445 end
1386
1446
1387 context "#done_ratio" do
1447 context "#done_ratio" do
1388 setup do
1448 setup do
1389 @issue = Issue.find(1)
1449 @issue = Issue.find(1)
1390 @issue_status = IssueStatus.find(1)
1450 @issue_status = IssueStatus.find(1)
1391 @issue_status.update_attribute(:default_done_ratio, 50)
1451 @issue_status.update_attribute(:default_done_ratio, 50)
1392 @issue2 = Issue.find(2)
1452 @issue2 = Issue.find(2)
1393 @issue_status2 = IssueStatus.find(2)
1453 @issue_status2 = IssueStatus.find(2)
1394 @issue_status2.update_attribute(:default_done_ratio, 0)
1454 @issue_status2.update_attribute(:default_done_ratio, 0)
1395 end
1455 end
1396
1456
1397 teardown do
1457 teardown do
1398 Setting.issue_done_ratio = 'issue_field'
1458 Setting.issue_done_ratio = 'issue_field'
1399 end
1459 end
1400
1460
1401 context "with Setting.issue_done_ratio using the issue_field" do
1461 context "with Setting.issue_done_ratio using the issue_field" do
1402 setup do
1462 setup do
1403 Setting.issue_done_ratio = 'issue_field'
1463 Setting.issue_done_ratio = 'issue_field'
1404 end
1464 end
1405
1465
1406 should "read the issue's field" do
1466 should "read the issue's field" do
1407 assert_equal 0, @issue.done_ratio
1467 assert_equal 0, @issue.done_ratio
1408 assert_equal 30, @issue2.done_ratio
1468 assert_equal 30, @issue2.done_ratio
1409 end
1469 end
1410 end
1470 end
1411
1471
1412 context "with Setting.issue_done_ratio using the issue_status" do
1472 context "with Setting.issue_done_ratio using the issue_status" do
1413 setup do
1473 setup do
1414 Setting.issue_done_ratio = 'issue_status'
1474 Setting.issue_done_ratio = 'issue_status'
1415 end
1475 end
1416
1476
1417 should "read the Issue Status's default done ratio" do
1477 should "read the Issue Status's default done ratio" do
1418 assert_equal 50, @issue.done_ratio
1478 assert_equal 50, @issue.done_ratio
1419 assert_equal 0, @issue2.done_ratio
1479 assert_equal 0, @issue2.done_ratio
1420 end
1480 end
1421 end
1481 end
1422 end
1482 end
1423
1483
1424 context "#update_done_ratio_from_issue_status" do
1484 context "#update_done_ratio_from_issue_status" do
1425 setup do
1485 setup do
1426 @issue = Issue.find(1)
1486 @issue = Issue.find(1)
1427 @issue_status = IssueStatus.find(1)
1487 @issue_status = IssueStatus.find(1)
1428 @issue_status.update_attribute(:default_done_ratio, 50)
1488 @issue_status.update_attribute(:default_done_ratio, 50)
1429 @issue2 = Issue.find(2)
1489 @issue2 = Issue.find(2)
1430 @issue_status2 = IssueStatus.find(2)
1490 @issue_status2 = IssueStatus.find(2)
1431 @issue_status2.update_attribute(:default_done_ratio, 0)
1491 @issue_status2.update_attribute(:default_done_ratio, 0)
1432 end
1492 end
1433
1493
1434 context "with Setting.issue_done_ratio using the issue_field" do
1494 context "with Setting.issue_done_ratio using the issue_field" do
1435 setup do
1495 setup do
1436 Setting.issue_done_ratio = 'issue_field'
1496 Setting.issue_done_ratio = 'issue_field'
1437 end
1497 end
1438
1498
1439 should "not change the issue" do
1499 should "not change the issue" do
1440 @issue.update_done_ratio_from_issue_status
1500 @issue.update_done_ratio_from_issue_status
1441 @issue2.update_done_ratio_from_issue_status
1501 @issue2.update_done_ratio_from_issue_status
1442
1502
1443 assert_equal 0, @issue.read_attribute(:done_ratio)
1503 assert_equal 0, @issue.read_attribute(:done_ratio)
1444 assert_equal 30, @issue2.read_attribute(:done_ratio)
1504 assert_equal 30, @issue2.read_attribute(:done_ratio)
1445 end
1505 end
1446 end
1506 end
1447
1507
1448 context "with Setting.issue_done_ratio using the issue_status" do
1508 context "with Setting.issue_done_ratio using the issue_status" do
1449 setup do
1509 setup do
1450 Setting.issue_done_ratio = 'issue_status'
1510 Setting.issue_done_ratio = 'issue_status'
1451 end
1511 end
1452
1512
1453 should "change the issue's done ratio" do
1513 should "change the issue's done ratio" do
1454 @issue.update_done_ratio_from_issue_status
1514 @issue.update_done_ratio_from_issue_status
1455 @issue2.update_done_ratio_from_issue_status
1515 @issue2.update_done_ratio_from_issue_status
1456
1516
1457 assert_equal 50, @issue.read_attribute(:done_ratio)
1517 assert_equal 50, @issue.read_attribute(:done_ratio)
1458 assert_equal 0, @issue2.read_attribute(:done_ratio)
1518 assert_equal 0, @issue2.read_attribute(:done_ratio)
1459 end
1519 end
1460 end
1520 end
1461 end
1521 end
1462
1522
1463 test "#by_tracker" do
1523 test "#by_tracker" do
1464 User.current = User.anonymous
1524 User.current = User.anonymous
1465 groups = Issue.by_tracker(Project.find(1))
1525 groups = Issue.by_tracker(Project.find(1))
1466 assert_equal 3, groups.size
1526 assert_equal 3, groups.size
1467 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1527 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1468 end
1528 end
1469
1529
1470 test "#by_version" do
1530 test "#by_version" do
1471 User.current = User.anonymous
1531 User.current = User.anonymous
1472 groups = Issue.by_version(Project.find(1))
1532 groups = Issue.by_version(Project.find(1))
1473 assert_equal 3, groups.size
1533 assert_equal 3, groups.size
1474 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1534 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1475 end
1535 end
1476
1536
1477 test "#by_priority" do
1537 test "#by_priority" do
1478 User.current = User.anonymous
1538 User.current = User.anonymous
1479 groups = Issue.by_priority(Project.find(1))
1539 groups = Issue.by_priority(Project.find(1))
1480 assert_equal 4, groups.size
1540 assert_equal 4, groups.size
1481 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1541 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1482 end
1542 end
1483
1543
1484 test "#by_category" do
1544 test "#by_category" do
1485 User.current = User.anonymous
1545 User.current = User.anonymous
1486 groups = Issue.by_category(Project.find(1))
1546 groups = Issue.by_category(Project.find(1))
1487 assert_equal 2, groups.size
1547 assert_equal 2, groups.size
1488 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1548 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1489 end
1549 end
1490
1550
1491 test "#by_assigned_to" do
1551 test "#by_assigned_to" do
1492 User.current = User.anonymous
1552 User.current = User.anonymous
1493 groups = Issue.by_assigned_to(Project.find(1))
1553 groups = Issue.by_assigned_to(Project.find(1))
1494 assert_equal 2, groups.size
1554 assert_equal 2, groups.size
1495 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1555 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1496 end
1556 end
1497
1557
1498 test "#by_author" do
1558 test "#by_author" do
1499 User.current = User.anonymous
1559 User.current = User.anonymous
1500 groups = Issue.by_author(Project.find(1))
1560 groups = Issue.by_author(Project.find(1))
1501 assert_equal 4, groups.size
1561 assert_equal 4, groups.size
1502 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1562 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1503 end
1563 end
1504
1564
1505 test "#by_subproject" do
1565 test "#by_subproject" do
1506 User.current = User.anonymous
1566 User.current = User.anonymous
1507 groups = Issue.by_subproject(Project.find(1))
1567 groups = Issue.by_subproject(Project.find(1))
1508 # Private descendant not visible
1568 # Private descendant not visible
1509 assert_equal 1, groups.size
1569 assert_equal 1, groups.size
1510 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1570 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1511 end
1571 end
1512
1572
1513 def test_recently_updated_scope
1573 def test_recently_updated_scope
1514 #should return the last updated issue
1574 #should return the last updated issue
1515 assert_equal Issue.reorder("updated_on DESC").first, Issue.recently_updated.limit(1).first
1575 assert_equal Issue.reorder("updated_on DESC").first, Issue.recently_updated.limit(1).first
1516 end
1576 end
1517
1577
1518 def test_on_active_projects_scope
1578 def test_on_active_projects_scope
1519 assert Project.find(2).archive
1579 assert Project.find(2).archive
1520
1580
1521 before = Issue.on_active_project.length
1581 before = Issue.on_active_project.length
1522 # test inclusion to results
1582 # test inclusion to results
1523 issue = Issue.generate_for_project!(Project.find(1), :tracker => Project.find(2).trackers.first)
1583 issue = Issue.generate_for_project!(Project.find(1), :tracker => Project.find(2).trackers.first)
1524 assert_equal before + 1, Issue.on_active_project.length
1584 assert_equal before + 1, Issue.on_active_project.length
1525
1585
1526 # Move to an archived project
1586 # Move to an archived project
1527 issue.project = Project.find(2)
1587 issue.project = Project.find(2)
1528 assert issue.save
1588 assert issue.save
1529 assert_equal before, Issue.on_active_project.length
1589 assert_equal before, Issue.on_active_project.length
1530 end
1590 end
1531
1591
1532 context "Issue#recipients" do
1592 context "Issue#recipients" do
1533 setup do
1593 setup do
1534 @project = Project.find(1)
1594 @project = Project.find(1)
1535 @author = User.generate!
1595 @author = User.generate!
1536 @assignee = User.generate!
1596 @assignee = User.generate!
1537 @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
1597 @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
1538 end
1598 end
1539
1599
1540 should "include project recipients" do
1600 should "include project recipients" do
1541 assert @project.recipients.present?
1601 assert @project.recipients.present?
1542 @project.recipients.each do |project_recipient|
1602 @project.recipients.each do |project_recipient|
1543 assert @issue.recipients.include?(project_recipient)
1603 assert @issue.recipients.include?(project_recipient)
1544 end
1604 end
1545 end
1605 end
1546
1606
1547 should "include the author if the author is active" do
1607 should "include the author if the author is active" do
1548 assert @issue.author, "No author set for Issue"
1608 assert @issue.author, "No author set for Issue"
1549 assert @issue.recipients.include?(@issue.author.mail)
1609 assert @issue.recipients.include?(@issue.author.mail)
1550 end
1610 end
1551
1611
1552 should "include the assigned to user if the assigned to user is active" do
1612 should "include the assigned to user if the assigned to user is active" do
1553 assert @issue.assigned_to, "No assigned_to set for Issue"
1613 assert @issue.assigned_to, "No assigned_to set for Issue"
1554 assert @issue.recipients.include?(@issue.assigned_to.mail)
1614 assert @issue.recipients.include?(@issue.assigned_to.mail)
1555 end
1615 end
1556
1616
1557 should "not include users who opt out of all email" do
1617 should "not include users who opt out of all email" do
1558 @author.update_attribute(:mail_notification, :none)
1618 @author.update_attribute(:mail_notification, :none)
1559
1619
1560 assert !@issue.recipients.include?(@issue.author.mail)
1620 assert !@issue.recipients.include?(@issue.author.mail)
1561 end
1621 end
1562
1622
1563 should "not include the issue author if they are only notified of assigned issues" do
1623 should "not include the issue author if they are only notified of assigned issues" do
1564 @author.update_attribute(:mail_notification, :only_assigned)
1624 @author.update_attribute(:mail_notification, :only_assigned)
1565
1625
1566 assert !@issue.recipients.include?(@issue.author.mail)
1626 assert !@issue.recipients.include?(@issue.author.mail)
1567 end
1627 end
1568
1628
1569 should "not include the assigned user if they are only notified of owned issues" do
1629 should "not include the assigned user if they are only notified of owned issues" do
1570 @assignee.update_attribute(:mail_notification, :only_owner)
1630 @assignee.update_attribute(:mail_notification, :only_owner)
1571
1631
1572 assert !@issue.recipients.include?(@issue.assigned_to.mail)
1632 assert !@issue.recipients.include?(@issue.assigned_to.mail)
1573 end
1633 end
1574 end
1634 end
1575
1635
1576 def test_last_journal_id_with_journals_should_return_the_journal_id
1636 def test_last_journal_id_with_journals_should_return_the_journal_id
1577 assert_equal 2, Issue.find(1).last_journal_id
1637 assert_equal 2, Issue.find(1).last_journal_id
1578 end
1638 end
1579
1639
1580 def test_last_journal_id_without_journals_should_return_nil
1640 def test_last_journal_id_without_journals_should_return_nil
1581 assert_nil Issue.find(3).last_journal_id
1641 assert_nil Issue.find(3).last_journal_id
1582 end
1642 end
1583
1643
1584 def test_journals_after_should_return_journals_with_greater_id
1644 def test_journals_after_should_return_journals_with_greater_id
1585 assert_equal [Journal.find(2)], Issue.find(1).journals_after('1')
1645 assert_equal [Journal.find(2)], Issue.find(1).journals_after('1')
1586 assert_equal [], Issue.find(1).journals_after('2')
1646 assert_equal [], Issue.find(1).journals_after('2')
1587 end
1647 end
1588
1648
1589 def test_journals_after_with_blank_arg_should_return_all_journals
1649 def test_journals_after_with_blank_arg_should_return_all_journals
1590 assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
1650 assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
1591 end
1651 end
1592 end
1652 end
General Comments 0
You need to be logged in to leave comments. Login now