##// 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 1 # encoding: utf-8
2 2 #
3 3 # Redmine - project management software
4 4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 5 #
6 6 # This program is free software; you can redistribute it and/or
7 7 # modify it under the terms of the GNU General Public License
8 8 # as published by the Free Software Foundation; either version 2
9 9 # of the License, or (at your option) any later version.
10 10 #
11 11 # This program is distributed in the hope that it will be useful,
12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14 # GNU General Public License for more details.
15 15 #
16 16 # You should have received a copy of the GNU General Public License
17 17 # along with this program; if not, write to the Free Software
18 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 19
20 20 module IssuesHelper
21 21 include ApplicationHelper
22 22
23 23 def issue_list(issues, &block)
24 24 ancestors = []
25 25 issues.each do |issue|
26 26 while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
27 27 ancestors.pop
28 28 end
29 29 yield issue, ancestors.size
30 30 ancestors << issue unless issue.leaf?
31 31 end
32 32 end
33 33
34 34 # Renders a HTML/CSS tooltip
35 35 #
36 36 # To use, a trigger div is needed. This is a div with the class of "tooltip"
37 37 # that contains this method wrapped in a span with the class of "tip"
38 38 #
39 39 # <div class="tooltip"><%= link_to_issue(issue) %>
40 40 # <span class="tip"><%= render_issue_tooltip(issue) %></span>
41 41 # </div>
42 42 #
43 43 def render_issue_tooltip(issue)
44 44 @cached_label_status ||= l(:field_status)
45 45 @cached_label_start_date ||= l(:field_start_date)
46 46 @cached_label_due_date ||= l(:field_due_date)
47 47 @cached_label_assigned_to ||= l(:field_assigned_to)
48 48 @cached_label_priority ||= l(:field_priority)
49 49 @cached_label_project ||= l(:field_project)
50 50
51 51 link_to_issue(issue) + "<br /><br />".html_safe +
52 52 "<strong>#{@cached_label_project}</strong>: #{link_to_project(issue.project)}<br />".html_safe +
53 53 "<strong>#{@cached_label_status}</strong>: #{h(issue.status.name)}<br />".html_safe +
54 54 "<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />".html_safe +
55 55 "<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.due_date)}<br />".html_safe +
56 56 "<strong>#{@cached_label_assigned_to}</strong>: #{h(issue.assigned_to)}<br />".html_safe +
57 57 "<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe
58 58 end
59 59
60 60 def issue_heading(issue)
61 61 h("#{issue.tracker} ##{issue.id}")
62 62 end
63 63
64 64 def render_issue_subject_with_tree(issue)
65 65 s = ''
66 66 ancestors = issue.root? ? [] : issue.ancestors.visible.all
67 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 69 end
70 70 s << '<div>'
71 71 subject = h(issue.subject)
72 72 if issue.is_private?
73 73 subject = content_tag('span', l(:field_is_private), :class => 'private') + ' ' + subject
74 74 end
75 75 s << content_tag('h3', subject)
76 76 s << '</div>' * (ancestors.size + 1)
77 77 s.html_safe
78 78 end
79 79
80 80 def render_descendants_tree(issue)
81 81 s = '<form><table class="list issues">'
82 82 issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
83 83 s << content_tag('tr',
84 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 86 content_tag('td', h(child.status)) +
87 87 content_tag('td', link_to_user(child.assigned_to)) +
88 88 content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
89 89 :class => "issue issue-#{child.id} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
90 90 end
91 91 s << '</table></form>'
92 92 s.html_safe
93 93 end
94 94
95 95 class IssueFieldsRows
96 96 include ActionView::Helpers::TagHelper
97 97
98 98 def initialize
99 99 @left = []
100 100 @right = []
101 101 end
102 102
103 103 def left(*args)
104 104 args.any? ? @left << cells(*args) : @left
105 105 end
106 106
107 107 def right(*args)
108 108 args.any? ? @right << cells(*args) : @right
109 109 end
110 110
111 111 def size
112 112 @left.size > @right.size ? @left.size : @right.size
113 113 end
114 114
115 115 def to_html
116 116 html = ''.html_safe
117 117 blank = content_tag('th', '') + content_tag('td', '')
118 118 size.times do |i|
119 119 left = @left[i] || blank
120 120 right = @right[i] || blank
121 121 html << content_tag('tr', left + right)
122 122 end
123 123 html
124 124 end
125 125
126 126 def cells(label, text, options={})
127 127 content_tag('th', "#{label}:", options) + content_tag('td', text, options)
128 128 end
129 129 end
130 130
131 131 def issue_fields_rows
132 132 r = IssueFieldsRows.new
133 133 yield r
134 134 r.to_html
135 135 end
136 136
137 137 def render_custom_fields_rows(issue)
138 138 return if issue.custom_field_values.empty?
139 139 ordered_values = []
140 140 half = (issue.custom_field_values.size / 2.0).ceil
141 141 half.times do |i|
142 142 ordered_values << issue.custom_field_values[i]
143 143 ordered_values << issue.custom_field_values[i + half]
144 144 end
145 145 s = "<tr>\n"
146 146 n = 0
147 147 ordered_values.compact.each do |value|
148 148 s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
149 149 s << "\t<th>#{ h(value.custom_field.name) }:</th><td>#{ simple_format_without_paragraph(h(show_value(value))) }</td>\n"
150 150 n += 1
151 151 end
152 152 s << "</tr>\n"
153 153 s.html_safe
154 154 end
155 155
156 156 def issues_destroy_confirmation_message(issues)
157 157 issues = [issues] unless issues.is_a?(Array)
158 158 message = l(:text_issues_destroy_confirmation)
159 159 descendant_count = issues.inject(0) {|memo, i| memo += (i.right - i.left - 1)/2}
160 160 if descendant_count > 0
161 161 issues.each do |issue|
162 162 next if issue.root?
163 163 issues.each do |other_issue|
164 164 descendant_count -= 1 if issue.is_descendant_of?(other_issue)
165 165 end
166 166 end
167 167 if descendant_count > 0
168 168 message << "\n" + l(:text_issues_destroy_descendants_confirmation, :count => descendant_count)
169 169 end
170 170 end
171 171 message
172 172 end
173 173
174 174 def sidebar_queries
175 175 unless @sidebar_queries
176 176 @sidebar_queries = Query.visible.all(
177 177 :order => "#{Query.table_name}.name ASC",
178 178 # Project specific queries and global queries
179 179 :conditions => (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
180 180 )
181 181 end
182 182 @sidebar_queries
183 183 end
184 184
185 185 def query_links(title, queries)
186 186 # links to #index on issues/show
187 187 url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
188 188
189 189 content_tag('h3', h(title)) +
190 190 queries.collect {|query|
191 191 css = 'query'
192 192 css << ' selected' if query == @query
193 193 link_to(h(query.name), url_params.merge(:query_id => query), :class => css)
194 194 }.join('<br />').html_safe
195 195 end
196 196
197 197 def render_sidebar_queries
198 198 out = ''.html_safe
199 199 queries = sidebar_queries.select {|q| !q.is_public?}
200 200 out << query_links(l(:label_my_queries), queries) if queries.any?
201 201 queries = sidebar_queries.select {|q| q.is_public?}
202 202 out << query_links(l(:label_query_plural), queries) if queries.any?
203 203 out
204 204 end
205 205
206 206 # Returns the textual representation of a journal details
207 207 # as an array of strings
208 208 def details_to_strings(details, no_html=false, options={})
209 209 options[:only_path] = (options[:only_path] == false ? false : true)
210 210 strings = []
211 211 values_by_field = {}
212 212 details.each do |detail|
213 213 if detail.property == 'cf'
214 214 field_id = detail.prop_key
215 215 field = CustomField.find_by_id(field_id)
216 216 if field && field.multiple?
217 217 values_by_field[field_id] ||= {:added => [], :deleted => []}
218 218 if detail.old_value
219 219 values_by_field[field_id][:deleted] << detail.old_value
220 220 end
221 221 if detail.value
222 222 values_by_field[field_id][:added] << detail.value
223 223 end
224 224 next
225 225 end
226 226 end
227 227 strings << show_detail(detail, no_html, options)
228 228 end
229 229 values_by_field.each do |field_id, changes|
230 230 detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
231 231 if changes[:added].any?
232 232 detail.value = changes[:added]
233 233 strings << show_detail(detail, no_html, options)
234 234 elsif changes[:deleted].any?
235 235 detail.old_value = changes[:deleted]
236 236 strings << show_detail(detail, no_html, options)
237 237 end
238 238 end
239 239 strings
240 240 end
241 241
242 242 # Returns the textual representation of a single journal detail
243 243 def show_detail(detail, no_html=false, options={})
244 244 multiple = false
245 245 case detail.property
246 246 when 'attr'
247 247 field = detail.prop_key.to_s.gsub(/\_id$/, "")
248 248 label = l(("field_" + field).to_sym)
249 249 case detail.prop_key
250 250 when 'due_date', 'start_date'
251 251 value = format_date(detail.value.to_date) if detail.value
252 252 old_value = format_date(detail.old_value.to_date) if detail.old_value
253 253
254 254 when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
255 255 'priority_id', 'category_id', 'fixed_version_id'
256 256 value = find_name_by_reflection(field, detail.value)
257 257 old_value = find_name_by_reflection(field, detail.old_value)
258 258
259 259 when 'estimated_hours'
260 260 value = "%0.02f" % detail.value.to_f unless detail.value.blank?
261 261 old_value = "%0.02f" % detail.old_value.to_f unless detail.old_value.blank?
262 262
263 263 when 'parent_id'
264 264 label = l(:field_parent_issue)
265 265 value = "##{detail.value}" unless detail.value.blank?
266 266 old_value = "##{detail.old_value}" unless detail.old_value.blank?
267 267
268 268 when 'is_private'
269 269 value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
270 270 old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
271 271 end
272 272 when 'cf'
273 273 custom_field = CustomField.find_by_id(detail.prop_key)
274 274 if custom_field
275 275 multiple = custom_field.multiple?
276 276 label = custom_field.name
277 277 value = format_value(detail.value, custom_field.field_format) if detail.value
278 278 old_value = format_value(detail.old_value, custom_field.field_format) if detail.old_value
279 279 end
280 280 when 'attachment'
281 281 label = l(:label_attachment)
282 282 end
283 283 call_hook(:helper_issues_show_detail_after_setting,
284 284 {:detail => detail, :label => label, :value => value, :old_value => old_value })
285 285
286 286 label ||= detail.prop_key
287 287 value ||= detail.value
288 288 old_value ||= detail.old_value
289 289
290 290 unless no_html
291 291 label = content_tag('strong', label)
292 292 old_value = content_tag("i", h(old_value)) if detail.old_value
293 293 old_value = content_tag("del", old_value) if detail.old_value and detail.value.blank?
294 294 if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key)
295 295 # Link to the attachment if it has not been removed
296 296 value = link_to_attachment(atta, :download => true, :only_path => options[:only_path])
297 297 if options[:only_path] != false && atta.is_text?
298 298 value += link_to(
299 299 image_tag('magnifier.png'),
300 300 :controller => 'attachments', :action => 'show',
301 301 :id => atta, :filename => atta.filename
302 302 )
303 303 end
304 304 else
305 305 value = content_tag("i", h(value)) if value
306 306 end
307 307 end
308 308
309 309 if detail.property == 'attr' && detail.prop_key == 'description'
310 310 s = l(:text_journal_changed_no_detail, :label => label)
311 311 unless no_html
312 312 diff_link = link_to 'diff',
313 313 {:controller => 'journals', :action => 'diff', :id => detail.journal_id,
314 314 :detail_id => detail.id, :only_path => options[:only_path]},
315 315 :title => l(:label_view_diff)
316 316 s << " (#{ diff_link })"
317 317 end
318 318 s.html_safe
319 319 elsif detail.value.present?
320 320 case detail.property
321 321 when 'attr', 'cf'
322 322 if detail.old_value.present?
323 323 l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe
324 324 elsif multiple
325 325 l(:text_journal_added, :label => label, :value => value).html_safe
326 326 else
327 327 l(:text_journal_set_to, :label => label, :value => value).html_safe
328 328 end
329 329 when 'attachment'
330 330 l(:text_journal_added, :label => label, :value => value).html_safe
331 331 end
332 332 else
333 333 l(:text_journal_deleted, :label => label, :old => old_value).html_safe
334 334 end
335 335 end
336 336
337 337 # Find the name of an associated record stored in the field attribute
338 338 def find_name_by_reflection(field, id)
339 339 association = Issue.reflect_on_association(field.to_sym)
340 340 if association
341 341 record = association.class_name.constantize.find_by_id(id)
342 342 return record.name if record
343 343 end
344 344 end
345 345
346 346 # Renders issue children recursively
347 347 def render_api_issue_children(issue, api)
348 348 return if issue.leaf?
349 349 api.array :children do
350 350 issue.children.each do |child|
351 351 api.issue(:id => child.id) do
352 352 api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil?
353 353 api.subject child.subject
354 354 render_api_issue_children(child, api)
355 355 end
356 356 end
357 357 end
358 358 end
359 359
360 360 def issues_to_csv(issues, project, query, options={})
361 361 decimal_separator = l(:general_csv_decimal_separator)
362 362 encoding = l(:general_csv_encoding)
363 363 columns = (options[:columns] == 'all' ? query.available_columns : query.columns)
364 364
365 365 export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
366 366 # csv header fields
367 367 csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
368 368 (options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
369 369
370 370 # csv lines
371 371 issues.each do |issue|
372 372 col_values = columns.collect do |column|
373 373 s = if column.is_a?(QueryCustomFieldColumn)
374 374 cv = issue.custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
375 375 show_value(cv)
376 376 else
377 377 value = column.value(issue)
378 378 if value.is_a?(Date)
379 379 format_date(value)
380 380 elsif value.is_a?(Time)
381 381 format_time(value)
382 382 elsif value.is_a?(Float)
383 383 ("%.2f" % value).gsub('.', decimal_separator)
384 384 else
385 385 value
386 386 end
387 387 end
388 388 s.to_s
389 389 end
390 390 csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } +
391 391 (options[:description] ? [Redmine::CodesetUtil.from_utf8(issue.description, encoding)] : [])
392 392 end
393 393 end
394 394 export
395 395 end
396 396 end
@@ -1,94 +1,106
1 1 # encoding: utf-8
2 2 #
3 3 # Redmine - project management software
4 4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 5 #
6 6 # This program is free software; you can redistribute it and/or
7 7 # modify it under the terms of the GNU General Public License
8 8 # as published by the Free Software Foundation; either version 2
9 9 # of the License, or (at your option) any later version.
10 10 #
11 11 # This program is distributed in the hope that it will be useful,
12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14 # GNU General Public License for more details.
15 15 #
16 16 # You should have received a copy of the GNU General Public License
17 17 # along with this program; if not, write to the Free Software
18 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 19
20 20 module SettingsHelper
21 21 def administration_settings_tabs
22 22 tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
23 23 {:name => 'display', :partial => 'settings/display', :label => :label_display},
24 24 {:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
25 25 {:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
26 26 {:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
27 27 {:name => 'notifications', :partial => 'settings/notifications', :label => :field_mail_notification},
28 28 {:name => 'mail_handler', :partial => 'settings/mail_handler', :label => :label_incoming_emails},
29 29 {:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
30 30 ]
31 31 end
32 32
33 33 def setting_select(setting, choices, options={})
34 34 if blank_text = options.delete(:blank)
35 35 choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
36 36 end
37 37 setting_label(setting, options).html_safe +
38 38 select_tag("settings[#{setting}]",
39 39 options_for_select(choices, Setting.send(setting).to_s),
40 40 options).html_safe
41 41 end
42 42
43 43 def setting_multiselect(setting, choices, options={})
44 44 setting_values = Setting.send(setting)
45 45 setting_values = [] unless setting_values.is_a?(Array)
46 46
47 47 content_tag("label", l(options[:label] || "setting_#{setting}")) +
48 48 hidden_field_tag("settings[#{setting}][]", '').html_safe +
49 49 choices.collect do |choice|
50 50 text, value = (choice.is_a?(Array) ? choice : [choice, choice])
51 51 content_tag(
52 52 'label',
53 53 check_box_tag(
54 54 "settings[#{setting}][]",
55 55 value,
56 56 Setting.send(setting).include?(value),
57 57 :id => nil
58 58 ) + text.to_s,
59 59 :class => 'block'
60 60 )
61 61 end.join.html_safe
62 62 end
63 63
64 64 def setting_text_field(setting, options={})
65 65 setting_label(setting, options).html_safe +
66 66 text_field_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
67 67 end
68 68
69 69 def setting_text_area(setting, options={})
70 70 setting_label(setting, options).html_safe +
71 71 text_area_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
72 72 end
73 73
74 74 def setting_check_box(setting, options={})
75 75 setting_label(setting, options).html_safe +
76 76 hidden_field_tag("settings[#{setting}]", 0, :id => nil).html_safe +
77 77 check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options).html_safe
78 78 end
79 79
80 80 def setting_label(setting, options={})
81 81 label = options.delete(:label)
82 82 label != false ? label_tag("settings_#{setting}", l(label || "setting_#{setting}")).html_safe : ''
83 83 end
84 84
85 85 # Renders a notification field for a Redmine::Notifiable option
86 86 def notification_field(notifiable)
87 87 return content_tag(:label,
88 88 check_box_tag('settings[notified_events][]',
89 89 notifiable.name,
90 90 Setting.notified_events.include?(notifiable.name), :id => nil).html_safe +
91 91 l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
92 92 :class => notifiable.parent.present? ? "parent" : '').html_safe
93 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 106 end
@@ -1,1333 +1,1354
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class Issue < ActiveRecord::Base
19 19 include Redmine::SafeAttributes
20 20
21 21 belongs_to :project
22 22 belongs_to :tracker
23 23 belongs_to :status, :class_name => 'IssueStatus', :foreign_key => 'status_id'
24 24 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
25 25 belongs_to :assigned_to, :class_name => 'Principal', :foreign_key => 'assigned_to_id'
26 26 belongs_to :fixed_version, :class_name => 'Version', :foreign_key => 'fixed_version_id'
27 27 belongs_to :priority, :class_name => 'IssuePriority', :foreign_key => 'priority_id'
28 28 belongs_to :category, :class_name => 'IssueCategory', :foreign_key => 'category_id'
29 29
30 30 has_many :journals, :as => :journalized, :dependent => :destroy
31 31 has_many :visible_journals,
32 32 :class_name => 'Journal',
33 33 :as => :journalized,
34 34 :conditions => Proc.new {
35 35 ["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false]
36 36 },
37 37 :readonly => true
38 38
39 39 has_many :time_entries, :dependent => :delete_all
40 40 has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"
41 41
42 42 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
43 43 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
44 44
45 45 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
46 46 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
47 47 acts_as_customizable
48 48 acts_as_watchable
49 49 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
50 50 :include => [:project, :visible_journals],
51 51 # sort by id so that limited eager loading doesn't break with postgresql
52 52 :order_column => "#{table_name}.id"
53 53 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
54 54 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
55 55 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
56 56
57 57 acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
58 58 :author_key => :author_id
59 59
60 60 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
61 61
62 62 attr_reader :current_journal
63 63 delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
64 64
65 65 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
66 66
67 67 validates_length_of :subject, :maximum => 255
68 68 validates_inclusion_of :done_ratio, :in => 0..100
69 69 validates_numericality_of :estimated_hours, :allow_nil => true
70 70 validate :validate_issue, :validate_required_fields
71 71
72 72 scope :visible,
73 73 lambda {|*args| { :include => :project,
74 74 :conditions => Issue.visible_condition(args.shift || User.current, *args) } }
75 75
76 76 scope :open, lambda {|*args|
77 77 is_closed = args.size > 0 ? !args.first : false
78 78 {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
79 79 }
80 80
81 81 scope :recently_updated, :order => "#{Issue.table_name}.updated_on DESC"
82 82 scope :on_active_project, :include => [:status, :project, :tracker],
83 83 :conditions => ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"]
84 84
85 85 before_create :default_assign
86 86 before_save :close_duplicates, :update_done_ratio_from_issue_status, :force_updated_on_change
87 87 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
88 88 after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
89 89 # Should be after_create but would be called before previous after_save callbacks
90 90 after_save :after_create_from_copy
91 91 after_destroy :update_parent_attributes
92 92
93 93 # Returns a SQL conditions string used to find all issues visible by the specified user
94 94 def self.visible_condition(user, options={})
95 95 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
96 96 if user.logged?
97 97 case role.issues_visibility
98 98 when 'all'
99 99 nil
100 100 when 'default'
101 101 user_ids = [user.id] + user.groups.map(&:id)
102 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 103 when 'own'
104 104 user_ids = [user.id] + user.groups.map(&:id)
105 105 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
106 106 else
107 107 '1=0'
108 108 end
109 109 else
110 110 "(#{table_name}.is_private = #{connection.quoted_false})"
111 111 end
112 112 end
113 113 end
114 114
115 115 # Returns true if usr or current user is allowed to view the issue
116 116 def visible?(usr=nil)
117 117 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
118 118 if user.logged?
119 119 case role.issues_visibility
120 120 when 'all'
121 121 true
122 122 when 'default'
123 123 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
124 124 when 'own'
125 125 self.author == user || user.is_or_belongs_to?(assigned_to)
126 126 else
127 127 false
128 128 end
129 129 else
130 130 !self.is_private?
131 131 end
132 132 end
133 133 end
134 134
135 135 def initialize(attributes=nil, *args)
136 136 super
137 137 if new_record?
138 138 # set default values for new records only
139 139 self.status ||= IssueStatus.default
140 140 self.priority ||= IssuePriority.default
141 141 self.watcher_user_ids = []
142 142 end
143 143 end
144 144
145 145 # AR#Persistence#destroy would raise and RecordNotFound exception
146 146 # if the issue was already deleted or updated (non matching lock_version).
147 147 # This is a problem when bulk deleting issues or deleting a project
148 148 # (because an issue may already be deleted if its parent was deleted
149 149 # first).
150 150 # The issue is reloaded by the nested_set before being deleted so
151 151 # the lock_version condition should not be an issue but we handle it.
152 152 def destroy
153 153 super
154 154 rescue ActiveRecord::RecordNotFound
155 155 # Stale or already deleted
156 156 begin
157 157 reload
158 158 rescue ActiveRecord::RecordNotFound
159 159 # The issue was actually already deleted
160 160 @destroyed = true
161 161 return freeze
162 162 end
163 163 # The issue was stale, retry to destroy
164 164 super
165 165 end
166 166
167 167 def reload(*args)
168 168 @workflow_rule_by_attribute = nil
169 169 @assignable_versions = nil
170 170 super
171 171 end
172 172
173 173 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
174 174 def available_custom_fields
175 175 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
176 176 end
177 177
178 178 # Copies attributes from another issue, arg can be an id or an Issue
179 179 def copy_from(arg, options={})
180 180 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
181 181 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
182 182 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
183 183 self.status = issue.status
184 184 self.author = User.current
185 185 unless options[:attachments] == false
186 186 self.attachments = issue.attachments.map do |attachement|
187 187 attachement.copy(:container => self)
188 188 end
189 189 end
190 190 @copied_from = issue
191 191 @copy_options = options
192 192 self
193 193 end
194 194
195 195 # Returns an unsaved copy of the issue
196 196 def copy(attributes=nil, copy_options={})
197 197 copy = self.class.new.copy_from(self, copy_options)
198 198 copy.attributes = attributes if attributes
199 199 copy
200 200 end
201 201
202 202 # Returns true if the issue is a copy
203 203 def copy?
204 204 @copied_from.present?
205 205 end
206 206
207 207 # Moves/copies an issue to a new project and tracker
208 208 # Returns the moved/copied issue on success, false on failure
209 209 def move_to_project(new_project, new_tracker=nil, options={})
210 210 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
211 211
212 212 if options[:copy]
213 213 issue = self.copy
214 214 else
215 215 issue = self
216 216 end
217 217
218 218 issue.init_journal(User.current, options[:notes])
219 219
220 220 # Preserve previous behaviour
221 221 # #move_to_project doesn't change tracker automatically
222 222 issue.send :project=, new_project, true
223 223 if new_tracker
224 224 issue.tracker = new_tracker
225 225 end
226 226 # Allow bulk setting of attributes on the issue
227 227 if options[:attributes]
228 228 issue.attributes = options[:attributes]
229 229 end
230 230
231 231 issue.save ? issue : false
232 232 end
233 233
234 234 def status_id=(sid)
235 235 self.status = nil
236 236 result = write_attribute(:status_id, sid)
237 237 @workflow_rule_by_attribute = nil
238 238 result
239 239 end
240 240
241 241 def priority_id=(pid)
242 242 self.priority = nil
243 243 write_attribute(:priority_id, pid)
244 244 end
245 245
246 246 def category_id=(cid)
247 247 self.category = nil
248 248 write_attribute(:category_id, cid)
249 249 end
250 250
251 251 def fixed_version_id=(vid)
252 252 self.fixed_version = nil
253 253 write_attribute(:fixed_version_id, vid)
254 254 end
255 255
256 256 def tracker_id=(tid)
257 257 self.tracker = nil
258 258 result = write_attribute(:tracker_id, tid)
259 259 @custom_field_values = nil
260 260 @workflow_rule_by_attribute = nil
261 261 result
262 262 end
263 263
264 264 def project_id=(project_id)
265 265 if project_id.to_s != self.project_id.to_s
266 266 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
267 267 end
268 268 end
269 269
270 270 def project=(project, keep_tracker=false)
271 271 project_was = self.project
272 272 write_attribute(:project_id, project ? project.id : nil)
273 273 association_instance_set('project', project)
274 274 if project_was && project && project_was != project
275 275 @assignable_versions = nil
276 276
277 277 unless keep_tracker || project.trackers.include?(tracker)
278 278 self.tracker = project.trackers.first
279 279 end
280 280 # Reassign to the category with same name if any
281 281 if category
282 282 self.category = project.issue_categories.find_by_name(category.name)
283 283 end
284 284 # Keep the fixed_version if it's still valid in the new_project
285 285 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
286 286 self.fixed_version = nil
287 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 290 self.parent_issue_id = nil
290 291 end
291 292 @custom_field_values = nil
292 293 end
293 294 end
294 295
295 296 def description=(arg)
296 297 if arg.is_a?(String)
297 298 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
298 299 end
299 300 write_attribute(:description, arg)
300 301 end
301 302
302 303 # Overrides assign_attributes so that project and tracker get assigned first
303 304 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
304 305 return if new_attributes.nil?
305 306 attrs = new_attributes.dup
306 307 attrs.stringify_keys!
307 308
308 309 %w(project project_id tracker tracker_id).each do |attr|
309 310 if attrs.has_key?(attr)
310 311 send "#{attr}=", attrs.delete(attr)
311 312 end
312 313 end
313 314 send :assign_attributes_without_project_and_tracker_first, attrs, *args
314 315 end
315 316 # Do not redefine alias chain on reload (see #4838)
316 317 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
317 318
318 319 def estimated_hours=(h)
319 320 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
320 321 end
321 322
322 323 safe_attributes 'project_id',
323 324 :if => lambda {|issue, user|
324 325 if issue.new_record?
325 326 issue.copy?
326 327 elsif user.allowed_to?(:move_issues, issue.project)
327 328 projects = Issue.allowed_target_projects_on_move(user)
328 329 projects.include?(issue.project) && projects.size > 1
329 330 end
330 331 }
331 332
332 333 safe_attributes 'tracker_id',
333 334 'status_id',
334 335 'category_id',
335 336 'assigned_to_id',
336 337 'priority_id',
337 338 'fixed_version_id',
338 339 'subject',
339 340 'description',
340 341 'start_date',
341 342 'due_date',
342 343 'done_ratio',
343 344 'estimated_hours',
344 345 'custom_field_values',
345 346 'custom_fields',
346 347 'lock_version',
347 348 'notes',
348 349 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
349 350
350 351 safe_attributes 'status_id',
351 352 'assigned_to_id',
352 353 'fixed_version_id',
353 354 'done_ratio',
354 355 'lock_version',
355 356 'notes',
356 357 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
357 358
358 359 safe_attributes 'notes',
359 360 :if => lambda {|issue, user| user.allowed_to?(:add_issue_notes, issue.project)}
360 361
361 362 safe_attributes 'private_notes',
362 363 :if => lambda {|issue, user| !issue.new_record? && user.allowed_to?(:set_notes_private, issue.project)}
363 364
364 365 safe_attributes 'watcher_user_ids',
365 366 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
366 367
367 368 safe_attributes 'is_private',
368 369 :if => lambda {|issue, user|
369 370 user.allowed_to?(:set_issues_private, issue.project) ||
370 371 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
371 372 }
372 373
373 374 safe_attributes 'parent_issue_id',
374 375 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
375 376 user.allowed_to?(:manage_subtasks, issue.project)}
376 377
377 378 def safe_attribute_names(user=nil)
378 379 names = super
379 380 names -= disabled_core_fields
380 381 names -= read_only_attribute_names(user)
381 382 names
382 383 end
383 384
384 385 # Safely sets attributes
385 386 # Should be called from controllers instead of #attributes=
386 387 # attr_accessible is too rough because we still want things like
387 388 # Issue.new(:project => foo) to work
388 389 def safe_attributes=(attrs, user=User.current)
389 390 return unless attrs.is_a?(Hash)
390 391
391 392 attrs = attrs.dup
392 393
393 394 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
394 395 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
395 396 if allowed_target_projects(user).collect(&:id).include?(p.to_i)
396 397 self.project_id = p
397 398 end
398 399 end
399 400
400 401 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
401 402 self.tracker_id = t
402 403 end
403 404
404 405 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
405 406 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
406 407 self.status_id = s
407 408 end
408 409 end
409 410
410 411 attrs = delete_unsafe_attributes(attrs, user)
411 412 return if attrs.empty?
412 413
413 414 unless leaf?
414 415 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
415 416 end
416 417
417 418 if attrs['parent_issue_id'].present?
418 419 attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i)
419 420 end
420 421
421 422 if attrs['custom_field_values'].present?
422 423 attrs['custom_field_values'] = attrs['custom_field_values'].reject {|k, v| read_only_attribute_names(user).include? k.to_s}
423 424 end
424 425
425 426 if attrs['custom_fields'].present?
426 427 attrs['custom_fields'] = attrs['custom_fields'].reject {|c| read_only_attribute_names(user).include? c['id'].to_s}
427 428 end
428 429
429 430 # mass-assignment security bypass
430 431 assign_attributes attrs, :without_protection => true
431 432 end
432 433
433 434 def disabled_core_fields
434 435 tracker ? tracker.disabled_core_fields : []
435 436 end
436 437
437 438 # Returns the custom_field_values that can be edited by the given user
438 439 def editable_custom_field_values(user=nil)
439 440 custom_field_values.reject do |value|
440 441 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
441 442 end
442 443 end
443 444
444 445 # Returns the names of attributes that are read-only for user or the current user
445 446 # For users with multiple roles, the read-only fields are the intersection of
446 447 # read-only fields of each role
447 448 # The result is an array of strings where sustom fields are represented with their ids
448 449 #
449 450 # Examples:
450 451 # issue.read_only_attribute_names # => ['due_date', '2']
451 452 # issue.read_only_attribute_names(user) # => []
452 453 def read_only_attribute_names(user=nil)
453 454 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
454 455 end
455 456
456 457 # Returns the names of required attributes for user or the current user
457 458 # For users with multiple roles, the required fields are the intersection of
458 459 # required fields of each role
459 460 # The result is an array of strings where sustom fields are represented with their ids
460 461 #
461 462 # Examples:
462 463 # issue.required_attribute_names # => ['due_date', '2']
463 464 # issue.required_attribute_names(user) # => []
464 465 def required_attribute_names(user=nil)
465 466 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
466 467 end
467 468
468 469 # Returns true if the attribute is required for user
469 470 def required_attribute?(name, user=nil)
470 471 required_attribute_names(user).include?(name.to_s)
471 472 end
472 473
473 474 # Returns a hash of the workflow rule by attribute for the given user
474 475 #
475 476 # Examples:
476 477 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
477 478 def workflow_rule_by_attribute(user=nil)
478 479 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
479 480
480 481 user_real = user || User.current
481 482 roles = user_real.admin ? Role.all : user_real.roles_for_project(project)
482 483 return {} if roles.empty?
483 484
484 485 result = {}
485 486 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).all
486 487 if workflow_permissions.any?
487 488 workflow_rules = workflow_permissions.inject({}) do |h, wp|
488 489 h[wp.field_name] ||= []
489 490 h[wp.field_name] << wp.rule
490 491 h
491 492 end
492 493 workflow_rules.each do |attr, rules|
493 494 next if rules.size < roles.size
494 495 uniq_rules = rules.uniq
495 496 if uniq_rules.size == 1
496 497 result[attr] = uniq_rules.first
497 498 else
498 499 result[attr] = 'required'
499 500 end
500 501 end
501 502 end
502 503 @workflow_rule_by_attribute = result if user.nil?
503 504 result
504 505 end
505 506 private :workflow_rule_by_attribute
506 507
507 508 def done_ratio
508 509 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
509 510 status.default_done_ratio
510 511 else
511 512 read_attribute(:done_ratio)
512 513 end
513 514 end
514 515
515 516 def self.use_status_for_done_ratio?
516 517 Setting.issue_done_ratio == 'issue_status'
517 518 end
518 519
519 520 def self.use_field_for_done_ratio?
520 521 Setting.issue_done_ratio == 'issue_field'
521 522 end
522 523
523 524 def validate_issue
524 525 if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
525 526 errors.add :due_date, :not_a_date
526 527 end
527 528
528 529 if self.due_date and self.start_date and self.due_date < self.start_date
529 530 errors.add :due_date, :greater_than_start_date
530 531 end
531 532
532 533 if start_date && soonest_start && start_date < soonest_start
533 534 errors.add :start_date, :invalid
534 535 end
535 536
536 537 if fixed_version
537 538 if !assignable_versions.include?(fixed_version)
538 539 errors.add :fixed_version_id, :inclusion
539 540 elsif reopened? && fixed_version.closed?
540 541 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
541 542 end
542 543 end
543 544
544 545 # Checks that the issue can not be added/moved to a disabled tracker
545 546 if project && (tracker_id_changed? || project_id_changed?)
546 547 unless project.trackers.include?(tracker)
547 548 errors.add :tracker_id, :inclusion
548 549 end
549 550 end
550 551
551 552 # Checks parent issue assignment
552 553 if @parent_issue
553 if @parent_issue.project_id != project_id
554 errors.add :parent_issue_id, :not_same_project
554 if !valid_parent_project?(@parent_issue)
555 errors.add :parent_issue_id, :invalid
555 556 elsif !new_record?
556 557 # moving an existing issue
557 558 if @parent_issue.root_id != root_id
558 559 # we can always move to another tree
559 560 elsif move_possible?(@parent_issue)
560 561 # move accepted inside tree
561 562 else
562 errors.add :parent_issue_id, :not_a_valid_parent
563 errors.add :parent_issue_id, :invalid
563 564 end
564 565 end
565 566 end
566 567 end
567 568
568 569 # Validates the issue against additional workflow requirements
569 570 def validate_required_fields
570 571 user = new_record? ? author : current_journal.try(:user)
571 572
572 573 required_attribute_names(user).each do |attribute|
573 574 if attribute =~ /^\d+$/
574 575 attribute = attribute.to_i
575 576 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
576 577 if v && v.value.blank?
577 578 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
578 579 end
579 580 else
580 581 if respond_to?(attribute) && send(attribute).blank?
581 582 errors.add attribute, :blank
582 583 end
583 584 end
584 585 end
585 586 end
586 587
587 588 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
588 589 # even if the user turns off the setting later
589 590 def update_done_ratio_from_issue_status
590 591 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
591 592 self.done_ratio = status.default_done_ratio
592 593 end
593 594 end
594 595
595 596 def init_journal(user, notes = "")
596 597 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
597 598 if new_record?
598 599 @current_journal.notify = false
599 600 else
600 601 @attributes_before_change = attributes.dup
601 602 @custom_values_before_change = {}
602 603 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
603 604 end
604 605 @current_journal
605 606 end
606 607
607 608 # Returns the id of the last journal or nil
608 609 def last_journal_id
609 610 if new_record?
610 611 nil
611 612 else
612 613 journals.maximum(:id)
613 614 end
614 615 end
615 616
616 617 # Returns a scope for journals that have an id greater than journal_id
617 618 def journals_after(journal_id)
618 619 scope = journals.reorder("#{Journal.table_name}.id ASC")
619 620 if journal_id.present?
620 621 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
621 622 end
622 623 scope
623 624 end
624 625
625 626 # Return true if the issue is closed, otherwise false
626 627 def closed?
627 628 self.status.is_closed?
628 629 end
629 630
630 631 # Return true if the issue is being reopened
631 632 def reopened?
632 633 if !new_record? && status_id_changed?
633 634 status_was = IssueStatus.find_by_id(status_id_was)
634 635 status_new = IssueStatus.find_by_id(status_id)
635 636 if status_was && status_new && status_was.is_closed? && !status_new.is_closed?
636 637 return true
637 638 end
638 639 end
639 640 false
640 641 end
641 642
642 643 # Return true if the issue is being closed
643 644 def closing?
644 645 if !new_record? && status_id_changed?
645 646 status_was = IssueStatus.find_by_id(status_id_was)
646 647 status_new = IssueStatus.find_by_id(status_id)
647 648 if status_was && status_new && !status_was.is_closed? && status_new.is_closed?
648 649 return true
649 650 end
650 651 end
651 652 false
652 653 end
653 654
654 655 # Returns true if the issue is overdue
655 656 def overdue?
656 657 !due_date.nil? && (due_date < Date.today) && !status.is_closed?
657 658 end
658 659
659 660 # Is the amount of work done less than it should for the due date
660 661 def behind_schedule?
661 662 return false if start_date.nil? || due_date.nil?
662 663 done_date = start_date + ((due_date - start_date+1)* done_ratio/100).floor
663 664 return done_date <= Date.today
664 665 end
665 666
666 667 # Does this issue have children?
667 668 def children?
668 669 !leaf?
669 670 end
670 671
671 672 # Users the issue can be assigned to
672 673 def assignable_users
673 674 users = project.assignable_users
674 675 users << author if author
675 676 users << assigned_to if assigned_to
676 677 users.uniq.sort
677 678 end
678 679
679 680 # Versions that the issue can be assigned to
680 681 def assignable_versions
681 682 return @assignable_versions if @assignable_versions
682 683
683 684 versions = project.shared_versions.open.all
684 685 if fixed_version
685 686 if fixed_version_id_changed?
686 687 # nothing to do
687 688 elsif project_id_changed?
688 689 if project.shared_versions.include?(fixed_version)
689 690 versions << fixed_version
690 691 end
691 692 else
692 693 versions << fixed_version
693 694 end
694 695 end
695 696 @assignable_versions = versions.uniq.sort
696 697 end
697 698
698 699 # Returns true if this issue is blocked by another issue that is still open
699 700 def blocked?
700 701 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
701 702 end
702 703
703 704 # Returns an array of statuses that user is able to apply
704 705 def new_statuses_allowed_to(user=User.current, include_default=false)
705 706 if new_record? && @copied_from
706 707 [IssueStatus.default, @copied_from.status].compact.uniq.sort
707 708 else
708 709 initial_status = nil
709 710 if new_record?
710 711 initial_status = IssueStatus.default
711 712 elsif status_id_was
712 713 initial_status = IssueStatus.find_by_id(status_id_was)
713 714 end
714 715 initial_status ||= status
715 716
716 717 statuses = initial_status.find_new_statuses_allowed_to(
717 718 user.admin ? Role.all : user.roles_for_project(project),
718 719 tracker,
719 720 author == user,
720 721 assigned_to_id_changed? ? assigned_to_id_was == user.id : assigned_to_id == user.id
721 722 )
722 723 statuses << initial_status unless statuses.empty?
723 724 statuses << IssueStatus.default if include_default
724 725 statuses = statuses.compact.uniq.sort
725 726 blocked? ? statuses.reject {|s| s.is_closed?} : statuses
726 727 end
727 728 end
728 729
729 730 def assigned_to_was
730 731 if assigned_to_id_changed? && assigned_to_id_was.present?
731 732 @assigned_to_was ||= User.find_by_id(assigned_to_id_was)
732 733 end
733 734 end
734 735
735 736 # Returns the users that should be notified
736 737 def notified_users
737 738 notified = []
738 739 # Author and assignee are always notified unless they have been
739 740 # locked or don't want to be notified
740 741 notified << author if author
741 742 if assigned_to
742 743 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
743 744 end
744 745 if assigned_to_was
745 746 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
746 747 end
747 748 notified = notified.select {|u| u.active? && u.notify_about?(self)}
748 749
749 750 notified += project.notified_users
750 751 notified.uniq!
751 752 # Remove users that can not view the issue
752 753 notified.reject! {|user| !visible?(user)}
753 754 notified
754 755 end
755 756
756 757 # Returns the email addresses that should be notified
757 758 def recipients
758 759 notified_users.collect(&:mail)
759 760 end
760 761
761 762 # Returns the number of hours spent on this issue
762 763 def spent_hours
763 764 @spent_hours ||= time_entries.sum(:hours) || 0
764 765 end
765 766
766 767 # Returns the total number of hours spent on this issue and its descendants
767 768 #
768 769 # Example:
769 770 # spent_hours => 0.0
770 771 # spent_hours => 50.2
771 772 def total_spent_hours
772 773 @total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
773 774 :joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").to_f || 0.0
774 775 end
775 776
776 777 def relations
777 778 @relations ||= IssueRelations.new(self, (relations_from + relations_to).sort)
778 779 end
779 780
780 781 # Preloads relations for a collection of issues
781 782 def self.load_relations(issues)
782 783 if issues.any?
783 784 relations = IssueRelation.all(:conditions => ["issue_from_id IN (:ids) OR issue_to_id IN (:ids)", {:ids => issues.map(&:id)}])
784 785 issues.each do |issue|
785 786 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
786 787 end
787 788 end
788 789 end
789 790
790 791 # Preloads visible spent time for a collection of issues
791 792 def self.load_visible_spent_hours(issues, user=User.current)
792 793 if issues.any?
793 794 hours_by_issue_id = TimeEntry.visible(user).sum(:hours, :group => :issue_id)
794 795 issues.each do |issue|
795 796 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
796 797 end
797 798 end
798 799 end
799 800
800 801 # Preloads visible relations for a collection of issues
801 802 def self.load_visible_relations(issues, user=User.current)
802 803 if issues.any?
803 804 issue_ids = issues.map(&:id)
804 805 # Relations with issue_from in given issues and visible issue_to
805 806 relations_from = IssueRelation.includes(:issue_to => [:status, :project]).where(visible_condition(user)).where(:issue_from_id => issue_ids).all
806 807 # Relations with issue_to in given issues and visible issue_from
807 808 relations_to = IssueRelation.includes(:issue_from => [:status, :project]).where(visible_condition(user)).where(:issue_to_id => issue_ids).all
808 809
809 810 issues.each do |issue|
810 811 relations =
811 812 relations_from.select {|relation| relation.issue_from_id == issue.id} +
812 813 relations_to.select {|relation| relation.issue_to_id == issue.id}
813 814
814 815 issue.instance_variable_set "@relations", IssueRelations.new(issue, relations.sort)
815 816 end
816 817 end
817 818 end
818 819
819 820 # Finds an issue relation given its id.
820 821 def find_relation(relation_id)
821 822 IssueRelation.find(relation_id, :conditions => ["issue_to_id = ? OR issue_from_id = ?", id, id])
822 823 end
823 824
824 825 def all_dependent_issues(except=[])
825 826 except << self
826 827 dependencies = []
827 828 relations_from.each do |relation|
828 829 if relation.issue_to && !except.include?(relation.issue_to)
829 830 dependencies << relation.issue_to
830 831 dependencies += relation.issue_to.all_dependent_issues(except)
831 832 end
832 833 end
833 834 dependencies
834 835 end
835 836
836 837 # Returns an array of issues that duplicate this one
837 838 def duplicates
838 839 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
839 840 end
840 841
841 842 # Returns the due date or the target due date if any
842 843 # Used on gantt chart
843 844 def due_before
844 845 due_date || (fixed_version ? fixed_version.effective_date : nil)
845 846 end
846 847
847 848 # Returns the time scheduled for this issue.
848 849 #
849 850 # Example:
850 851 # Start Date: 2/26/09, End Date: 3/04/09
851 852 # duration => 6
852 853 def duration
853 854 (start_date && due_date) ? due_date - start_date : 0
854 855 end
855 856
856 857 def soonest_start
857 858 @soonest_start ||= (
858 859 relations_to.collect{|relation| relation.successor_soonest_start} +
859 860 ancestors.collect(&:soonest_start)
860 861 ).compact.max
861 862 end
862 863
863 864 def reschedule_after(date)
864 865 return if date.nil?
865 866 if leaf?
866 867 if start_date.nil? || start_date < date
867 868 self.start_date, self.due_date = date, date + duration
868 869 begin
869 870 save
870 871 rescue ActiveRecord::StaleObjectError
871 872 reload
872 873 self.start_date, self.due_date = date, date + duration
873 874 save
874 875 end
875 876 end
876 877 else
877 878 leaves.each do |leaf|
878 879 leaf.reschedule_after(date)
879 880 end
880 881 end
881 882 end
882 883
883 884 def <=>(issue)
884 885 if issue.nil?
885 886 -1
886 887 elsif root_id != issue.root_id
887 888 (root_id || 0) <=> (issue.root_id || 0)
888 889 else
889 890 (lft || 0) <=> (issue.lft || 0)
890 891 end
891 892 end
892 893
893 894 def to_s
894 895 "#{tracker} ##{id}: #{subject}"
895 896 end
896 897
897 898 # Returns a string of css classes that apply to the issue
898 899 def css_classes
899 900 s = "issue status-#{status_id} priority-#{priority_id}"
900 901 s << ' closed' if closed?
901 902 s << ' overdue' if overdue?
902 903 s << ' child' if child?
903 904 s << ' parent' unless leaf?
904 905 s << ' private' if is_private?
905 906 s << ' created-by-me' if User.current.logged? && author_id == User.current.id
906 907 s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id
907 908 s
908 909 end
909 910
910 911 # Saves an issue and a time_entry from the parameters
911 912 def save_issue_with_child_records(params, existing_time_entry=nil)
912 913 Issue.transaction do
913 914 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, project)
914 915 @time_entry = existing_time_entry || TimeEntry.new
915 916 @time_entry.project = project
916 917 @time_entry.issue = self
917 918 @time_entry.user = User.current
918 919 @time_entry.spent_on = User.current.today
919 920 @time_entry.attributes = params[:time_entry]
920 921 self.time_entries << @time_entry
921 922 end
922 923
923 924 # TODO: Rename hook
924 925 Redmine::Hook.call_hook(:controller_issues_edit_before_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
925 926 if save
926 927 # TODO: Rename hook
927 928 Redmine::Hook.call_hook(:controller_issues_edit_after_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
928 929 else
929 930 raise ActiveRecord::Rollback
930 931 end
931 932 end
932 933 end
933 934
934 935 # Unassigns issues from +version+ if it's no longer shared with issue's project
935 936 def self.update_versions_from_sharing_change(version)
936 937 # Update issues assigned to the version
937 938 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
938 939 end
939 940
940 941 # Unassigns issues from versions that are no longer shared
941 942 # after +project+ was moved
942 943 def self.update_versions_from_hierarchy_change(project)
943 944 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
944 945 # Update issues of the moved projects and issues assigned to a version of a moved project
945 946 Issue.update_versions(["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", moved_project_ids, moved_project_ids])
946 947 end
947 948
948 949 def parent_issue_id=(arg)
949 950 parent_issue_id = arg.blank? ? nil : arg.to_i
950 951 if parent_issue_id && @parent_issue = Issue.find_by_id(parent_issue_id)
951 952 @parent_issue.id
952 953 else
953 954 @parent_issue = nil
954 955 nil
955 956 end
956 957 end
957 958
958 959 def parent_issue_id
959 960 if instance_variable_defined? :@parent_issue
960 961 @parent_issue.nil? ? nil : @parent_issue.id
961 962 else
962 963 parent_id
963 964 end
964 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 986 # Extracted from the ReportsController.
967 987 def self.by_tracker(project)
968 988 count_and_group_by(:project => project,
969 989 :field => 'tracker_id',
970 990 :joins => Tracker.table_name)
971 991 end
972 992
973 993 def self.by_version(project)
974 994 count_and_group_by(:project => project,
975 995 :field => 'fixed_version_id',
976 996 :joins => Version.table_name)
977 997 end
978 998
979 999 def self.by_priority(project)
980 1000 count_and_group_by(:project => project,
981 1001 :field => 'priority_id',
982 1002 :joins => IssuePriority.table_name)
983 1003 end
984 1004
985 1005 def self.by_category(project)
986 1006 count_and_group_by(:project => project,
987 1007 :field => 'category_id',
988 1008 :joins => IssueCategory.table_name)
989 1009 end
990 1010
991 1011 def self.by_assigned_to(project)
992 1012 count_and_group_by(:project => project,
993 1013 :field => 'assigned_to_id',
994 1014 :joins => User.table_name)
995 1015 end
996 1016
997 1017 def self.by_author(project)
998 1018 count_and_group_by(:project => project,
999 1019 :field => 'author_id',
1000 1020 :joins => User.table_name)
1001 1021 end
1002 1022
1003 1023 def self.by_subproject(project)
1004 1024 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1005 1025 s.is_closed as closed,
1006 1026 #{Issue.table_name}.project_id as project_id,
1007 1027 count(#{Issue.table_name}.id) as total
1008 1028 from
1009 1029 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s
1010 1030 where
1011 1031 #{Issue.table_name}.status_id=s.id
1012 1032 and #{Issue.table_name}.project_id = #{Project.table_name}.id
1013 1033 and #{visible_condition(User.current, :project => project, :with_subprojects => true)}
1014 1034 and #{Issue.table_name}.project_id <> #{project.id}
1015 1035 group by s.id, s.is_closed, #{Issue.table_name}.project_id") if project.descendants.active.any?
1016 1036 end
1017 1037 # End ReportsController extraction
1018 1038
1019 1039 # Returns an array of projects that user can assign the issue to
1020 1040 def allowed_target_projects(user=User.current)
1021 1041 if new_record?
1022 1042 Project.all(:conditions => Project.allowed_to_condition(user, :add_issues))
1023 1043 else
1024 1044 self.class.allowed_target_projects_on_move(user)
1025 1045 end
1026 1046 end
1027 1047
1028 1048 # Returns an array of projects that user can move issues to
1029 1049 def self.allowed_target_projects_on_move(user=User.current)
1030 1050 Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
1031 1051 end
1032 1052
1033 1053 private
1034 1054
1035 1055 def after_project_change
1036 1056 # Update project_id on related time entries
1037 1057 TimeEntry.update_all(["project_id = ?", project_id], {:issue_id => id})
1038 1058
1039 1059 # Delete issue relations
1040 1060 unless Setting.cross_project_issue_relations?
1041 1061 relations_from.clear
1042 1062 relations_to.clear
1043 1063 end
1044 1064
1045 # Move subtasks
1065 # Move subtasks that were in the same project
1046 1066 children.each do |child|
1067 next unless child.project_id == project_id_was
1047 1068 # Change project and keep project
1048 1069 child.send :project=, project, true
1049 1070 unless child.save
1050 1071 raise ActiveRecord::Rollback
1051 1072 end
1052 1073 end
1053 1074 end
1054 1075
1055 1076 # Callback for after the creation of an issue by copy
1056 1077 # * adds a "copied to" relation with the copied issue
1057 1078 # * copies subtasks from the copied issue
1058 1079 def after_create_from_copy
1059 1080 return unless copy? && !@after_create_from_copy_handled
1060 1081
1061 1082 if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
1062 1083 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1063 1084 unless relation.save
1064 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 1086 end
1066 1087 end
1067 1088
1068 1089 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1069 1090 @copied_from.children.each do |child|
1070 1091 unless child.visible?
1071 1092 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1072 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 1094 next
1074 1095 end
1075 1096 copy = Issue.new.copy_from(child, @copy_options)
1076 1097 copy.author = author
1077 1098 copy.project = project
1078 1099 copy.parent_issue_id = id
1079 1100 # Children subtasks are copied recursively
1080 1101 unless copy.save
1081 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 1103 end
1083 1104 end
1084 1105 end
1085 1106 @after_create_from_copy_handled = true
1086 1107 end
1087 1108
1088 1109 def update_nested_set_attributes
1089 1110 if root_id.nil?
1090 1111 # issue was just created
1091 1112 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1092 1113 set_default_left_and_right
1093 1114 Issue.update_all("root_id = #{root_id}, lft = #{lft}, rgt = #{rgt}", ["id = ?", id])
1094 1115 if @parent_issue
1095 1116 move_to_child_of(@parent_issue)
1096 1117 end
1097 1118 reload
1098 1119 elsif parent_issue_id != parent_id
1099 1120 former_parent_id = parent_id
1100 1121 # moving an existing issue
1101 1122 if @parent_issue && @parent_issue.root_id == root_id
1102 1123 # inside the same tree
1103 1124 move_to_child_of(@parent_issue)
1104 1125 else
1105 1126 # to another tree
1106 1127 unless root?
1107 1128 move_to_right_of(root)
1108 1129 reload
1109 1130 end
1110 1131 old_root_id = root_id
1111 1132 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
1112 1133 target_maxright = nested_set_scope.maximum(right_column_name) || 0
1113 1134 offset = target_maxright + 1 - lft
1114 1135 Issue.update_all("root_id = #{root_id}, lft = lft + #{offset}, rgt = rgt + #{offset}",
1115 1136 ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt])
1116 1137 self[left_column_name] = lft + offset
1117 1138 self[right_column_name] = rgt + offset
1118 1139 if @parent_issue
1119 1140 move_to_child_of(@parent_issue)
1120 1141 end
1121 1142 end
1122 1143 reload
1123 1144 # delete invalid relations of all descendants
1124 1145 self_and_descendants.each do |issue|
1125 1146 issue.relations.each do |relation|
1126 1147 relation.destroy unless relation.valid?
1127 1148 end
1128 1149 end
1129 1150 # update former parent
1130 1151 recalculate_attributes_for(former_parent_id) if former_parent_id
1131 1152 end
1132 1153 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1133 1154 end
1134 1155
1135 1156 def update_parent_attributes
1136 1157 recalculate_attributes_for(parent_id) if parent_id
1137 1158 end
1138 1159
1139 1160 def recalculate_attributes_for(issue_id)
1140 1161 if issue_id && p = Issue.find_by_id(issue_id)
1141 1162 # priority = highest priority of children
1142 1163 if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :joins => :priority)
1143 1164 p.priority = IssuePriority.find_by_position(priority_position)
1144 1165 end
1145 1166
1146 1167 # start/due dates = lowest/highest dates of children
1147 1168 p.start_date = p.children.minimum(:start_date)
1148 1169 p.due_date = p.children.maximum(:due_date)
1149 1170 if p.start_date && p.due_date && p.due_date < p.start_date
1150 1171 p.start_date, p.due_date = p.due_date, p.start_date
1151 1172 end
1152 1173
1153 1174 # done ratio = weighted average ratio of leaves
1154 1175 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1155 1176 leaves_count = p.leaves.count
1156 1177 if leaves_count > 0
1157 1178 average = p.leaves.average(:estimated_hours).to_f
1158 1179 if average == 0
1159 1180 average = 1
1160 1181 end
1161 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 1183 progress = done / (average * leaves_count)
1163 1184 p.done_ratio = progress.round
1164 1185 end
1165 1186 end
1166 1187
1167 1188 # estimate = sum of leaves estimates
1168 1189 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1169 1190 p.estimated_hours = nil if p.estimated_hours == 0.0
1170 1191
1171 1192 # ancestors will be recursively updated
1172 1193 p.save(:validate => false)
1173 1194 end
1174 1195 end
1175 1196
1176 1197 # Update issues so their versions are not pointing to a
1177 1198 # fixed_version that is not shared with the issue's project
1178 1199 def self.update_versions(conditions=nil)
1179 1200 # Only need to update issues with a fixed_version from
1180 1201 # a different project and that is not systemwide shared
1181 1202 Issue.scoped(:conditions => conditions).all(
1182 1203 :conditions => "#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1183 1204 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1184 1205 " AND #{Version.table_name}.sharing <> 'system'",
1185 1206 :include => [:project, :fixed_version]
1186 1207 ).each do |issue|
1187 1208 next if issue.project.nil? || issue.fixed_version.nil?
1188 1209 unless issue.project.shared_versions.include?(issue.fixed_version)
1189 1210 issue.init_journal(User.current)
1190 1211 issue.fixed_version = nil
1191 1212 issue.save
1192 1213 end
1193 1214 end
1194 1215 end
1195 1216
1196 1217 # Callback on file attachment
1197 1218 def attachment_added(obj)
1198 1219 if @current_journal && !obj.new_record?
1199 1220 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1200 1221 end
1201 1222 end
1202 1223
1203 1224 # Callback on attachment deletion
1204 1225 def attachment_removed(obj)
1205 1226 if @current_journal && !obj.new_record?
1206 1227 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1207 1228 @current_journal.save
1208 1229 end
1209 1230 end
1210 1231
1211 1232 # Default assignment based on category
1212 1233 def default_assign
1213 1234 if assigned_to.nil? && category && category.assigned_to
1214 1235 self.assigned_to = category.assigned_to
1215 1236 end
1216 1237 end
1217 1238
1218 1239 # Updates start/due dates of following issues
1219 1240 def reschedule_following_issues
1220 1241 if start_date_changed? || due_date_changed?
1221 1242 relations_from.each do |relation|
1222 1243 relation.set_issue_to_dates
1223 1244 end
1224 1245 end
1225 1246 end
1226 1247
1227 1248 # Closes duplicates if the issue is being closed
1228 1249 def close_duplicates
1229 1250 if closing?
1230 1251 duplicates.each do |duplicate|
1231 1252 # Reload is need in case the duplicate was updated by a previous duplicate
1232 1253 duplicate.reload
1233 1254 # Don't re-close it if it's already closed
1234 1255 next if duplicate.closed?
1235 1256 # Same user and notes
1236 1257 if @current_journal
1237 1258 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1238 1259 end
1239 1260 duplicate.update_attribute :status, self.status
1240 1261 end
1241 1262 end
1242 1263 end
1243 1264
1244 1265 # Make sure updated_on is updated when adding a note
1245 1266 def force_updated_on_change
1246 1267 if @current_journal
1247 1268 self.updated_on = current_time_from_proper_timezone
1248 1269 end
1249 1270 end
1250 1271
1251 1272 # Saves the changes in a Journal
1252 1273 # Called after_save
1253 1274 def create_journal
1254 1275 if @current_journal
1255 1276 # attributes changes
1256 1277 if @attributes_before_change
1257 1278 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on)).each {|c|
1258 1279 before = @attributes_before_change[c]
1259 1280 after = send(c)
1260 1281 next if before == after || (before.blank? && after.blank?)
1261 1282 @current_journal.details << JournalDetail.new(:property => 'attr',
1262 1283 :prop_key => c,
1263 1284 :old_value => before,
1264 1285 :value => after)
1265 1286 }
1266 1287 end
1267 1288 if @custom_values_before_change
1268 1289 # custom fields changes
1269 1290 custom_field_values.each {|c|
1270 1291 before = @custom_values_before_change[c.custom_field_id]
1271 1292 after = c.value
1272 1293 next if before == after || (before.blank? && after.blank?)
1273 1294
1274 1295 if before.is_a?(Array) || after.is_a?(Array)
1275 1296 before = [before] unless before.is_a?(Array)
1276 1297 after = [after] unless after.is_a?(Array)
1277 1298
1278 1299 # values removed
1279 1300 (before - after).reject(&:blank?).each do |value|
1280 1301 @current_journal.details << JournalDetail.new(:property => 'cf',
1281 1302 :prop_key => c.custom_field_id,
1282 1303 :old_value => value,
1283 1304 :value => nil)
1284 1305 end
1285 1306 # values added
1286 1307 (after - before).reject(&:blank?).each do |value|
1287 1308 @current_journal.details << JournalDetail.new(:property => 'cf',
1288 1309 :prop_key => c.custom_field_id,
1289 1310 :old_value => nil,
1290 1311 :value => value)
1291 1312 end
1292 1313 else
1293 1314 @current_journal.details << JournalDetail.new(:property => 'cf',
1294 1315 :prop_key => c.custom_field_id,
1295 1316 :old_value => before,
1296 1317 :value => after)
1297 1318 end
1298 1319 }
1299 1320 end
1300 1321 @current_journal.save
1301 1322 # reset current journal
1302 1323 init_journal @current_journal.user, @current_journal.notes
1303 1324 end
1304 1325 end
1305 1326
1306 1327 # Query generator for selecting groups of issue counts for a project
1307 1328 # based on specific criteria
1308 1329 #
1309 1330 # Options
1310 1331 # * project - Project to search in.
1311 1332 # * field - String. Issue field to key off of in the grouping.
1312 1333 # * joins - String. The table name to join against.
1313 1334 def self.count_and_group_by(options)
1314 1335 project = options.delete(:project)
1315 1336 select_field = options.delete(:field)
1316 1337 joins = options.delete(:joins)
1317 1338
1318 1339 where = "#{Issue.table_name}.#{select_field}=j.id"
1319 1340
1320 1341 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1321 1342 s.is_closed as closed,
1322 1343 j.id as #{select_field},
1323 1344 count(#{Issue.table_name}.id) as total
1324 1345 from
1325 1346 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s, #{joins} j
1326 1347 where
1327 1348 #{Issue.table_name}.status_id=s.id
1328 1349 and #{where}
1329 1350 and #{Issue.table_name}.project_id=#{Project.table_name}.id
1330 1351 and #{visible_condition(User.current, :project => project)}
1331 1352 group by s.id, s.is_closed, j.id")
1332 1353 end
1333 1354 end
@@ -1,73 +1,73
1 1 <%= labelled_fields_for :issue, @issue do |f| %>
2 2
3 3 <div class="splitcontent">
4 4 <div class="splitcontentleft">
5 5 <% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
6 6 <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
7 7 :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
8 8
9 9 <% else %>
10 10 <p><label><%= l(:field_status) %></label> <%= h(@issue.status.name) %></p>
11 11 <% end %>
12 12
13 13 <% if @issue.safe_attribute? 'priority_id' %>
14 14 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
15 15 <% end %>
16 16
17 17 <% if @issue.safe_attribute? 'assigned_to_id' %>
18 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 19 <% end %>
20 20
21 21 <% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
22 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 23 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
24 24 new_project_issue_category_path(@issue.project),
25 25 :remote => true,
26 26 :method => 'get',
27 27 :title => l(:label_issue_category_new),
28 28 :tabindex => 200) if User.current.allowed_to?(:manage_categories, @issue.project) %></p>
29 29 <% end %>
30 30
31 31 <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
32 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 33 <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
34 34 new_project_version_path(@issue.project),
35 35 :remote => true,
36 36 :method => 'get',
37 37 :title => l(:label_version_new),
38 38 :tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
39 39 </p>
40 40 <% end %>
41 41 </div>
42 42
43 43 <div class="splitcontentright">
44 44 <% if @issue.safe_attribute? 'parent_issue_id' %>
45 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 47 <% end %>
48 48
49 49 <% if @issue.safe_attribute? 'start_date' %>
50 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 51 <% end %>
52 52
53 53 <% if @issue.safe_attribute? 'due_date' %>
54 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 55 <% end %>
56 56
57 57 <% if @issue.safe_attribute? 'estimated_hours' %>
58 58 <p><%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
59 59 <% end %>
60 60
61 61 <% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
62 62 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
63 63 <% end %>
64 64 </div>
65 65 </div>
66 66
67 67 <% if @issue.safe_attribute? 'custom_field_values' %>
68 68 <%= render :partial => 'issues/form_custom_fields' %>
69 69 <% end %>
70 70
71 71 <% end %>
72 72
73 73 <% include_calendar_headers_tags %>
@@ -1,29 +1,31
1 1 <%= form_tag({:action => 'edit', :tab => 'issues'}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
2 2
3 3 <div class="box tabular settings">
4 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 8 <p><%= setting_check_box :issue_group_assignment %></p>
7 9
8 10 <p><%= setting_check_box :default_issue_start_date_to_creation_date %></p>
9 11
10 12 <p><%= setting_check_box :display_subprojects_issues %></p>
11 13
12 14 <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
13 15
14 16 <p><%= setting_text_field :issues_export_limit, :size => 6 %></p>
15 17
16 18 <p><%= setting_text_field :gantt_items_limit, :size => 6 %></p>
17 19 </div>
18 20
19 21 <fieldset class="box">
20 22 <legend><%= l(:setting_issue_list_default_columns) %></legend>
21 23 <%= render :partial => 'queries/columns',
22 24 :locals => {
23 25 :query => Query.new(:column_names => Setting.issue_list_default_columns),
24 26 :tag_name => 'settings[issue_list_default_columns][]'
25 27 } %>
26 28 </fieldset>
27 29
28 30 <%= submit_tag l(:button_save) %>
29 31 <% end %>
@@ -1,1072 +1,1073
1 1 en:
2 2 # Text direction: Left-to-Right (ltr) or Right-to-Left (rtl)
3 3 direction: ltr
4 4 date:
5 5 formats:
6 6 # Use the strftime parameters for formats.
7 7 # When no format has been given, it uses default.
8 8 # You can provide other formats here if you like!
9 9 default: "%m/%d/%Y"
10 10 short: "%b %d"
11 11 long: "%B %d, %Y"
12 12
13 13 day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
14 14 abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
15 15
16 16 # Don't forget the nil at the beginning; there's no such thing as a 0th month
17 17 month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
18 18 abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
19 19 # Used in date_select and datime_select.
20 20 order:
21 21 - :year
22 22 - :month
23 23 - :day
24 24
25 25 time:
26 26 formats:
27 27 default: "%m/%d/%Y %I:%M %p"
28 28 time: "%I:%M %p"
29 29 short: "%d %b %H:%M"
30 30 long: "%B %d, %Y %H:%M"
31 31 am: "am"
32 32 pm: "pm"
33 33
34 34 datetime:
35 35 distance_in_words:
36 36 half_a_minute: "half a minute"
37 37 less_than_x_seconds:
38 38 one: "less than 1 second"
39 39 other: "less than %{count} seconds"
40 40 x_seconds:
41 41 one: "1 second"
42 42 other: "%{count} seconds"
43 43 less_than_x_minutes:
44 44 one: "less than a minute"
45 45 other: "less than %{count} minutes"
46 46 x_minutes:
47 47 one: "1 minute"
48 48 other: "%{count} minutes"
49 49 about_x_hours:
50 50 one: "about 1 hour"
51 51 other: "about %{count} hours"
52 52 x_hours:
53 53 one: "1 hour"
54 54 other: "%{count} hours"
55 55 x_days:
56 56 one: "1 day"
57 57 other: "%{count} days"
58 58 about_x_months:
59 59 one: "about 1 month"
60 60 other: "about %{count} months"
61 61 x_months:
62 62 one: "1 month"
63 63 other: "%{count} months"
64 64 about_x_years:
65 65 one: "about 1 year"
66 66 other: "about %{count} years"
67 67 over_x_years:
68 68 one: "over 1 year"
69 69 other: "over %{count} years"
70 70 almost_x_years:
71 71 one: "almost 1 year"
72 72 other: "almost %{count} years"
73 73
74 74 number:
75 75 format:
76 76 separator: "."
77 77 delimiter: ""
78 78 precision: 3
79 79
80 80 human:
81 81 format:
82 82 delimiter: ""
83 83 precision: 3
84 84 storage_units:
85 85 format: "%n %u"
86 86 units:
87 87 byte:
88 88 one: "Byte"
89 89 other: "Bytes"
90 90 kb: "KB"
91 91 mb: "MB"
92 92 gb: "GB"
93 93 tb: "TB"
94 94
95 95 # Used in array.to_sentence.
96 96 support:
97 97 array:
98 98 sentence_connector: "and"
99 99 skip_last_comma: false
100 100
101 101 activerecord:
102 102 errors:
103 103 template:
104 104 header:
105 105 one: "1 error prohibited this %{model} from being saved"
106 106 other: "%{count} errors prohibited this %{model} from being saved"
107 107 messages:
108 108 inclusion: "is not included in the list"
109 109 exclusion: "is reserved"
110 110 invalid: "is invalid"
111 111 confirmation: "doesn't match confirmation"
112 112 accepted: "must be accepted"
113 113 empty: "can't be empty"
114 114 blank: "can't be blank"
115 115 too_long: "is too long (maximum is %{count} characters)"
116 116 too_short: "is too short (minimum is %{count} characters)"
117 117 wrong_length: "is the wrong length (should be %{count} characters)"
118 118 taken: "has already been taken"
119 119 not_a_number: "is not a number"
120 120 not_a_date: "is not a valid date"
121 121 greater_than: "must be greater than %{count}"
122 122 greater_than_or_equal_to: "must be greater than or equal to %{count}"
123 123 equal_to: "must be equal to %{count}"
124 124 less_than: "must be less than %{count}"
125 125 less_than_or_equal_to: "must be less than or equal to %{count}"
126 126 odd: "must be odd"
127 127 even: "must be even"
128 128 greater_than_start_date: "must be greater than start date"
129 129 not_same_project: "doesn't belong to the same project"
130 130 circular_dependency: "This relation would create a circular dependency"
131 131 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
132 132
133 133 actionview_instancetag_blank_option: Please select
134 134
135 135 general_text_No: 'No'
136 136 general_text_Yes: 'Yes'
137 137 general_text_no: 'no'
138 138 general_text_yes: 'yes'
139 139 general_lang_name: 'English'
140 140 general_csv_separator: ','
141 141 general_csv_decimal_separator: '.'
142 142 general_csv_encoding: ISO-8859-1
143 143 general_pdf_encoding: UTF-8
144 144 general_first_day_of_week: '7'
145 145
146 146 notice_account_updated: Account was successfully updated.
147 147 notice_account_invalid_creditentials: Invalid user or password
148 148 notice_account_password_updated: Password was successfully updated.
149 149 notice_account_wrong_password: Wrong password
150 150 notice_account_register_done: Account was successfully created. To activate your account, click on the link that was emailed to you.
151 151 notice_account_unknown_email: Unknown user.
152 152 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
153 153 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
154 154 notice_account_activated: Your account has been activated. You can now log in.
155 155 notice_successful_create: Successful creation.
156 156 notice_successful_update: Successful update.
157 157 notice_successful_delete: Successful deletion.
158 158 notice_successful_connection: Successful connection.
159 159 notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
160 160 notice_locking_conflict: Data has been updated by another user.
161 161 notice_not_authorized: You are not authorized to access this page.
162 162 notice_not_authorized_archived_project: The project you're trying to access has been archived.
163 163 notice_email_sent: "An email was sent to %{value}"
164 164 notice_email_error: "An error occurred while sending mail (%{value})"
165 165 notice_feeds_access_key_reseted: Your RSS access key was reset.
166 166 notice_api_access_key_reseted: Your API access key was reset.
167 167 notice_failed_to_save_issues: "Failed to save %{count} issue(s) on %{total} selected: %{ids}."
168 168 notice_failed_to_save_time_entries: "Failed to save %{count} time entrie(s) on %{total} selected: %{ids}."
169 169 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
170 170 notice_no_issue_selected: "No issue is selected! Please, check the issues you want to edit."
171 171 notice_account_pending: "Your account was created and is now pending administrator approval."
172 172 notice_default_data_loaded: Default configuration successfully loaded.
173 173 notice_unable_delete_version: Unable to delete version.
174 174 notice_unable_delete_time_entry: Unable to delete time log entry.
175 175 notice_issue_done_ratios_updated: Issue done ratios updated.
176 176 notice_gantt_chart_truncated: "The chart was truncated because it exceeds the maximum number of items that can be displayed (%{max})"
177 177 notice_issue_successful_create: "Issue %{id} created."
178 178 notice_issue_update_conflict: "The issue has been updated by an other user while you were editing it."
179 179 notice_account_deleted: "Your account has been permanently deleted."
180 180 notice_user_successful_create: "User %{id} created."
181 181
182 182 error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
183 183 error_scm_not_found: "The entry or revision was not found in the repository."
184 184 error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
185 185 error_scm_annotate: "The entry does not exist or cannot be annotated."
186 186 error_scm_annotate_big_text_file: "The entry cannot be annotated, as it exceeds the maximum text file size."
187 187 error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
188 188 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
189 189 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
190 190 error_can_not_delete_custom_field: Unable to delete custom field
191 191 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
192 192 error_can_not_remove_role: "This role is in use and cannot be deleted."
193 193 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version cannot be reopened'
194 194 error_can_not_archive_project: This project cannot be archived
195 195 error_issue_done_ratios_not_updated: "Issue done ratios not updated."
196 196 error_workflow_copy_source: 'Please select a source tracker or role'
197 197 error_workflow_copy_target: 'Please select target tracker(s) and role(s)'
198 198 error_unable_delete_issue_status: 'Unable to delete issue status'
199 199 error_unable_to_connect: "Unable to connect (%{value})"
200 200 error_attachment_too_big: "This file cannot be uploaded because it exceeds the maximum allowed file size (%{max_size})"
201 201 error_session_expired: "Your session has expired. Please login again."
202 202 warning_attachments_not_saved: "%{count} file(s) could not be saved."
203 203
204 204 mail_subject_lost_password: "Your %{value} password"
205 205 mail_body_lost_password: 'To change your password, click on the following link:'
206 206 mail_subject_register: "Your %{value} account activation"
207 207 mail_body_register: 'To activate your account, click on the following link:'
208 208 mail_body_account_information_external: "You can use your %{value} account to log in."
209 209 mail_body_account_information: Your account information
210 210 mail_subject_account_activation_request: "%{value} account activation request"
211 211 mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
212 212 mail_subject_reminder: "%{count} issue(s) due in the next %{days} days"
213 213 mail_body_reminder: "%{count} issue(s) that are assigned to you are due in the next %{days} days:"
214 214 mail_subject_wiki_content_added: "'%{id}' wiki page has been added"
215 215 mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}."
216 216 mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated"
217 217 mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}."
218 218
219 219 gui_validation_error: 1 error
220 220 gui_validation_error_plural: "%{count} errors"
221 221
222 222 field_name: Name
223 223 field_description: Description
224 224 field_summary: Summary
225 225 field_is_required: Required
226 226 field_firstname: First name
227 227 field_lastname: Last name
228 228 field_mail: Email
229 229 field_filename: File
230 230 field_filesize: Size
231 231 field_downloads: Downloads
232 232 field_author: Author
233 233 field_created_on: Created
234 234 field_updated_on: Updated
235 235 field_field_format: Format
236 236 field_is_for_all: For all projects
237 237 field_possible_values: Possible values
238 238 field_regexp: Regular expression
239 239 field_min_length: Minimum length
240 240 field_max_length: Maximum length
241 241 field_value: Value
242 242 field_category: Category
243 243 field_title: Title
244 244 field_project: Project
245 245 field_issue: Issue
246 246 field_status: Status
247 247 field_notes: Notes
248 248 field_is_closed: Issue closed
249 249 field_is_default: Default value
250 250 field_tracker: Tracker
251 251 field_subject: Subject
252 252 field_due_date: Due date
253 253 field_assigned_to: Assignee
254 254 field_priority: Priority
255 255 field_fixed_version: Target version
256 256 field_user: User
257 257 field_principal: Principal
258 258 field_role: Role
259 259 field_homepage: Homepage
260 260 field_is_public: Public
261 261 field_parent: Subproject of
262 262 field_is_in_roadmap: Issues displayed in roadmap
263 263 field_login: Login
264 264 field_mail_notification: Email notifications
265 265 field_admin: Administrator
266 266 field_last_login_on: Last connection
267 267 field_language: Language
268 268 field_effective_date: Date
269 269 field_password: Password
270 270 field_new_password: New password
271 271 field_password_confirmation: Confirmation
272 272 field_version: Version
273 273 field_type: Type
274 274 field_host: Host
275 275 field_port: Port
276 276 field_account: Account
277 277 field_base_dn: Base DN
278 278 field_attr_login: Login attribute
279 279 field_attr_firstname: Firstname attribute
280 280 field_attr_lastname: Lastname attribute
281 281 field_attr_mail: Email attribute
282 282 field_onthefly: On-the-fly user creation
283 283 field_start_date: Start date
284 284 field_done_ratio: "% Done"
285 285 field_auth_source: Authentication mode
286 286 field_hide_mail: Hide my email address
287 287 field_comments: Comment
288 288 field_url: URL
289 289 field_start_page: Start page
290 290 field_subproject: Subproject
291 291 field_hours: Hours
292 292 field_activity: Activity
293 293 field_spent_on: Date
294 294 field_identifier: Identifier
295 295 field_is_filter: Used as a filter
296 296 field_issue_to: Related issue
297 297 field_delay: Delay
298 298 field_assignable: Issues can be assigned to this role
299 299 field_redirect_existing_links: Redirect existing links
300 300 field_estimated_hours: Estimated time
301 301 field_column_names: Columns
302 302 field_time_entries: Log time
303 303 field_time_zone: Time zone
304 304 field_searchable: Searchable
305 305 field_default_value: Default value
306 306 field_comments_sorting: Display comments
307 307 field_parent_title: Parent page
308 308 field_editable: Editable
309 309 field_watcher: Watcher
310 310 field_identity_url: OpenID URL
311 311 field_content: Content
312 312 field_group_by: Group results by
313 313 field_sharing: Sharing
314 314 field_parent_issue: Parent task
315 315 field_member_of_group: "Assignee's group"
316 316 field_assigned_to_role: "Assignee's role"
317 317 field_text: Text field
318 318 field_visible: Visible
319 319 field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
320 320 field_issues_visibility: Issues visibility
321 321 field_is_private: Private
322 322 field_commit_logs_encoding: Commit messages encoding
323 323 field_scm_path_encoding: Path encoding
324 324 field_path_to_repository: Path to repository
325 325 field_root_directory: Root directory
326 326 field_cvsroot: CVSROOT
327 327 field_cvs_module: Module
328 328 field_repository_is_default: Main repository
329 329 field_multiple: Multiple values
330 330 field_auth_source_ldap_filter: LDAP filter
331 331 field_core_fields: Standard fields
332 332 field_timeout: "Timeout (in seconds)"
333 333 field_board_parent: Parent forum
334 334 field_private_notes: Private notes
335 335
336 336 setting_app_title: Application title
337 337 setting_app_subtitle: Application subtitle
338 338 setting_welcome_text: Welcome text
339 339 setting_default_language: Default language
340 340 setting_login_required: Authentication required
341 341 setting_self_registration: Self-registration
342 342 setting_attachment_max_size: Maximum attachment size
343 343 setting_issues_export_limit: Issues export limit
344 344 setting_mail_from: Emission email address
345 345 setting_bcc_recipients: Blind carbon copy recipients (bcc)
346 346 setting_plain_text_mail: Plain text mail (no HTML)
347 347 setting_host_name: Host name and path
348 348 setting_text_formatting: Text formatting
349 349 setting_wiki_compression: Wiki history compression
350 350 setting_feeds_limit: Maximum number of items in Atom feeds
351 351 setting_default_projects_public: New projects are public by default
352 352 setting_autofetch_changesets: Fetch commits automatically
353 353 setting_sys_api_enabled: Enable WS for repository management
354 354 setting_commit_ref_keywords: Referencing keywords
355 355 setting_commit_fix_keywords: Fixing keywords
356 356 setting_autologin: Autologin
357 357 setting_date_format: Date format
358 358 setting_time_format: Time format
359 359 setting_cross_project_issue_relations: Allow cross-project issue relations
360 setting_cross_project_subtasks: Allow cross-project subtasks
360 361 setting_issue_list_default_columns: Default columns displayed on the issue list
361 362 setting_repositories_encodings: Attachments and repositories encodings
362 363 setting_emails_header: Emails header
363 364 setting_emails_footer: Emails footer
364 365 setting_protocol: Protocol
365 366 setting_per_page_options: Objects per page options
366 367 setting_user_format: Users display format
367 368 setting_activity_days_default: Days displayed on project activity
368 369 setting_display_subprojects_issues: Display subprojects issues on main projects by default
369 370 setting_enabled_scm: Enabled SCM
370 371 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
371 372 setting_mail_handler_api_enabled: Enable WS for incoming emails
372 373 setting_mail_handler_api_key: API key
373 374 setting_sequential_project_identifiers: Generate sequential project identifiers
374 375 setting_gravatar_enabled: Use Gravatar user icons
375 376 setting_gravatar_default: Default Gravatar image
376 377 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
377 378 setting_file_max_size_displayed: Maximum size of text files displayed inline
378 379 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
379 380 setting_openid: Allow OpenID login and registration
380 381 setting_password_min_length: Minimum password length
381 382 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
382 383 setting_default_projects_modules: Default enabled modules for new projects
383 384 setting_issue_done_ratio: Calculate the issue done ratio with
384 385 setting_issue_done_ratio_issue_field: Use the issue field
385 386 setting_issue_done_ratio_issue_status: Use the issue status
386 387 setting_start_of_week: Start calendars on
387 388 setting_rest_api_enabled: Enable REST web service
388 389 setting_cache_formatted_text: Cache formatted text
389 390 setting_default_notification_option: Default notification option
390 391 setting_commit_logtime_enabled: Enable time logging
391 392 setting_commit_logtime_activity_id: Activity for logged time
392 393 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
393 394 setting_issue_group_assignment: Allow issue assignment to groups
394 395 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
395 396 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
396 397 setting_unsubscribe: Allow users to delete their own account
397 398 setting_session_lifetime: Session maximum lifetime
398 399 setting_session_timeout: Session inactivity timeout
399 400 setting_thumbnails_enabled: Display attachment thumbnails
400 401 setting_thumbnails_size: Thumbnails size (in pixels)
401 402
402 403 permission_add_project: Create project
403 404 permission_add_subprojects: Create subprojects
404 405 permission_edit_project: Edit project
405 406 permission_close_project: Close / reopen the project
406 407 permission_select_project_modules: Select project modules
407 408 permission_manage_members: Manage members
408 409 permission_manage_project_activities: Manage project activities
409 410 permission_manage_versions: Manage versions
410 411 permission_manage_categories: Manage issue categories
411 412 permission_view_issues: View Issues
412 413 permission_add_issues: Add issues
413 414 permission_edit_issues: Edit issues
414 415 permission_manage_issue_relations: Manage issue relations
415 416 permission_set_issues_private: Set issues public or private
416 417 permission_set_own_issues_private: Set own issues public or private
417 418 permission_add_issue_notes: Add notes
418 419 permission_edit_issue_notes: Edit notes
419 420 permission_edit_own_issue_notes: Edit own notes
420 421 permission_view_private_notes: View private notes
421 422 permission_set_notes_private: Set notes as private
422 423 permission_move_issues: Move issues
423 424 permission_delete_issues: Delete issues
424 425 permission_manage_public_queries: Manage public queries
425 426 permission_save_queries: Save queries
426 427 permission_view_gantt: View gantt chart
427 428 permission_view_calendar: View calendar
428 429 permission_view_issue_watchers: View watchers list
429 430 permission_add_issue_watchers: Add watchers
430 431 permission_delete_issue_watchers: Delete watchers
431 432 permission_log_time: Log spent time
432 433 permission_view_time_entries: View spent time
433 434 permission_edit_time_entries: Edit time logs
434 435 permission_edit_own_time_entries: Edit own time logs
435 436 permission_manage_news: Manage news
436 437 permission_comment_news: Comment news
437 438 permission_manage_documents: Manage documents
438 439 permission_view_documents: View documents
439 440 permission_manage_files: Manage files
440 441 permission_view_files: View files
441 442 permission_manage_wiki: Manage wiki
442 443 permission_rename_wiki_pages: Rename wiki pages
443 444 permission_delete_wiki_pages: Delete wiki pages
444 445 permission_view_wiki_pages: View wiki
445 446 permission_view_wiki_edits: View wiki history
446 447 permission_edit_wiki_pages: Edit wiki pages
447 448 permission_delete_wiki_pages_attachments: Delete attachments
448 449 permission_protect_wiki_pages: Protect wiki pages
449 450 permission_manage_repository: Manage repository
450 451 permission_browse_repository: Browse repository
451 452 permission_view_changesets: View changesets
452 453 permission_commit_access: Commit access
453 454 permission_manage_boards: Manage forums
454 455 permission_view_messages: View messages
455 456 permission_add_messages: Post messages
456 457 permission_edit_messages: Edit messages
457 458 permission_edit_own_messages: Edit own messages
458 459 permission_delete_messages: Delete messages
459 460 permission_delete_own_messages: Delete own messages
460 461 permission_export_wiki_pages: Export wiki pages
461 462 permission_manage_subtasks: Manage subtasks
462 463 permission_manage_related_issues: Manage related issues
463 464
464 465 project_module_issue_tracking: Issue tracking
465 466 project_module_time_tracking: Time tracking
466 467 project_module_news: News
467 468 project_module_documents: Documents
468 469 project_module_files: Files
469 470 project_module_wiki: Wiki
470 471 project_module_repository: Repository
471 472 project_module_boards: Forums
472 473 project_module_calendar: Calendar
473 474 project_module_gantt: Gantt
474 475
475 476 label_user: User
476 477 label_user_plural: Users
477 478 label_user_new: New user
478 479 label_user_anonymous: Anonymous
479 480 label_project: Project
480 481 label_project_new: New project
481 482 label_project_plural: Projects
482 483 label_x_projects:
483 484 zero: no projects
484 485 one: 1 project
485 486 other: "%{count} projects"
486 487 label_project_all: All Projects
487 488 label_project_latest: Latest projects
488 489 label_issue: Issue
489 490 label_issue_new: New issue
490 491 label_issue_plural: Issues
491 492 label_issue_view_all: View all issues
492 493 label_issues_by: "Issues by %{value}"
493 494 label_issue_added: Issue added
494 495 label_issue_updated: Issue updated
495 496 label_issue_note_added: Note added
496 497 label_issue_status_updated: Status updated
497 498 label_issue_priority_updated: Priority updated
498 499 label_document: Document
499 500 label_document_new: New document
500 501 label_document_plural: Documents
501 502 label_document_added: Document added
502 503 label_role: Role
503 504 label_role_plural: Roles
504 505 label_role_new: New role
505 506 label_role_and_permissions: Roles and permissions
506 507 label_role_anonymous: Anonymous
507 508 label_role_non_member: Non member
508 509 label_member: Member
509 510 label_member_new: New member
510 511 label_member_plural: Members
511 512 label_tracker: Tracker
512 513 label_tracker_plural: Trackers
513 514 label_tracker_new: New tracker
514 515 label_workflow: Workflow
515 516 label_issue_status: Issue status
516 517 label_issue_status_plural: Issue statuses
517 518 label_issue_status_new: New status
518 519 label_issue_category: Issue category
519 520 label_issue_category_plural: Issue categories
520 521 label_issue_category_new: New category
521 522 label_custom_field: Custom field
522 523 label_custom_field_plural: Custom fields
523 524 label_custom_field_new: New custom field
524 525 label_enumerations: Enumerations
525 526 label_enumeration_new: New value
526 527 label_information: Information
527 528 label_information_plural: Information
528 529 label_please_login: Please log in
529 530 label_register: Register
530 531 label_login_with_open_id_option: or login with OpenID
531 532 label_password_lost: Lost password
532 533 label_home: Home
533 534 label_my_page: My page
534 535 label_my_account: My account
535 536 label_my_projects: My projects
536 537 label_my_page_block: My page block
537 538 label_administration: Administration
538 539 label_login: Sign in
539 540 label_logout: Sign out
540 541 label_help: Help
541 542 label_reported_issues: Reported issues
542 543 label_assigned_to_me_issues: Issues assigned to me
543 544 label_last_login: Last connection
544 545 label_registered_on: Registered on
545 546 label_activity: Activity
546 547 label_overall_activity: Overall activity
547 548 label_user_activity: "%{value}'s activity"
548 549 label_new: New
549 550 label_logged_as: Logged in as
550 551 label_environment: Environment
551 552 label_authentication: Authentication
552 553 label_auth_source: Authentication mode
553 554 label_auth_source_new: New authentication mode
554 555 label_auth_source_plural: Authentication modes
555 556 label_subproject_plural: Subprojects
556 557 label_subproject_new: New subproject
557 558 label_and_its_subprojects: "%{value} and its subprojects"
558 559 label_min_max_length: Min - Max length
559 560 label_list: List
560 561 label_date: Date
561 562 label_integer: Integer
562 563 label_float: Float
563 564 label_boolean: Boolean
564 565 label_string: Text
565 566 label_text: Long text
566 567 label_attribute: Attribute
567 568 label_attribute_plural: Attributes
568 569 label_download: "%{count} Download"
569 570 label_download_plural: "%{count} Downloads"
570 571 label_no_data: No data to display
571 572 label_change_status: Change status
572 573 label_history: History
573 574 label_attachment: File
574 575 label_attachment_new: New file
575 576 label_attachment_delete: Delete file
576 577 label_attachment_plural: Files
577 578 label_file_added: File added
578 579 label_report: Report
579 580 label_report_plural: Reports
580 581 label_news: News
581 582 label_news_new: Add news
582 583 label_news_plural: News
583 584 label_news_latest: Latest news
584 585 label_news_view_all: View all news
585 586 label_news_added: News added
586 587 label_news_comment_added: Comment added to a news
587 588 label_settings: Settings
588 589 label_overview: Overview
589 590 label_version: Version
590 591 label_version_new: New version
591 592 label_version_plural: Versions
592 593 label_close_versions: Close completed versions
593 594 label_confirmation: Confirmation
594 595 label_export_to: 'Also available in:'
595 596 label_read: Read...
596 597 label_public_projects: Public projects
597 598 label_open_issues: open
598 599 label_open_issues_plural: open
599 600 label_closed_issues: closed
600 601 label_closed_issues_plural: closed
601 602 label_x_open_issues_abbr_on_total:
602 603 zero: 0 open / %{total}
603 604 one: 1 open / %{total}
604 605 other: "%{count} open / %{total}"
605 606 label_x_open_issues_abbr:
606 607 zero: 0 open
607 608 one: 1 open
608 609 other: "%{count} open"
609 610 label_x_closed_issues_abbr:
610 611 zero: 0 closed
611 612 one: 1 closed
612 613 other: "%{count} closed"
613 614 label_x_issues:
614 615 zero: 0 issues
615 616 one: 1 issue
616 617 other: "%{count} issues"
617 618 label_total: Total
618 619 label_permissions: Permissions
619 620 label_current_status: Current status
620 621 label_new_statuses_allowed: New statuses allowed
621 622 label_all: all
622 623 label_any: any
623 624 label_none: none
624 625 label_nobody: nobody
625 626 label_next: Next
626 627 label_previous: Previous
627 628 label_used_by: Used by
628 629 label_details: Details
629 630 label_add_note: Add a note
630 631 label_per_page: Per page
631 632 label_calendar: Calendar
632 633 label_months_from: months from
633 634 label_gantt: Gantt
634 635 label_internal: Internal
635 636 label_last_changes: "last %{count} changes"
636 637 label_change_view_all: View all changes
637 638 label_personalize_page: Personalize this page
638 639 label_comment: Comment
639 640 label_comment_plural: Comments
640 641 label_x_comments:
641 642 zero: no comments
642 643 one: 1 comment
643 644 other: "%{count} comments"
644 645 label_comment_add: Add a comment
645 646 label_comment_added: Comment added
646 647 label_comment_delete: Delete comments
647 648 label_query: Custom query
648 649 label_query_plural: Custom queries
649 650 label_query_new: New query
650 651 label_my_queries: My custom queries
651 652 label_filter_add: Add filter
652 653 label_filter_plural: Filters
653 654 label_equals: is
654 655 label_not_equals: is not
655 656 label_in_less_than: in less than
656 657 label_in_more_than: in more than
657 658 label_greater_or_equal: '>='
658 659 label_less_or_equal: '<='
659 660 label_between: between
660 661 label_in: in
661 662 label_today: today
662 663 label_all_time: all time
663 664 label_yesterday: yesterday
664 665 label_this_week: this week
665 666 label_last_week: last week
666 667 label_last_n_weeks: "last %{count} weeks"
667 668 label_last_n_days: "last %{count} days"
668 669 label_this_month: this month
669 670 label_last_month: last month
670 671 label_this_year: this year
671 672 label_date_range: Date range
672 673 label_less_than_ago: less than days ago
673 674 label_more_than_ago: more than days ago
674 675 label_ago: days ago
675 676 label_contains: contains
676 677 label_not_contains: doesn't contain
677 678 label_any_issues_in_project: any issues in project
678 679 label_any_issues_not_in_project: any issues not in project
679 680 label_no_issues_in_project: no issues in project
680 681 label_day_plural: days
681 682 label_repository: Repository
682 683 label_repository_new: New repository
683 684 label_repository_plural: Repositories
684 685 label_browse: Browse
685 686 label_modification: "%{count} change"
686 687 label_modification_plural: "%{count} changes"
687 688 label_branch: Branch
688 689 label_tag: Tag
689 690 label_revision: Revision
690 691 label_revision_plural: Revisions
691 692 label_revision_id: "Revision %{value}"
692 693 label_associated_revisions: Associated revisions
693 694 label_added: added
694 695 label_modified: modified
695 696 label_copied: copied
696 697 label_renamed: renamed
697 698 label_deleted: deleted
698 699 label_latest_revision: Latest revision
699 700 label_latest_revision_plural: Latest revisions
700 701 label_view_revisions: View revisions
701 702 label_view_all_revisions: View all revisions
702 703 label_max_size: Maximum size
703 704 label_sort_highest: Move to top
704 705 label_sort_higher: Move up
705 706 label_sort_lower: Move down
706 707 label_sort_lowest: Move to bottom
707 708 label_roadmap: Roadmap
708 709 label_roadmap_due_in: "Due in %{value}"
709 710 label_roadmap_overdue: "%{value} late"
710 711 label_roadmap_no_issues: No issues for this version
711 712 label_search: Search
712 713 label_result_plural: Results
713 714 label_all_words: All words
714 715 label_wiki: Wiki
715 716 label_wiki_edit: Wiki edit
716 717 label_wiki_edit_plural: Wiki edits
717 718 label_wiki_page: Wiki page
718 719 label_wiki_page_plural: Wiki pages
719 720 label_index_by_title: Index by title
720 721 label_index_by_date: Index by date
721 722 label_current_version: Current version
722 723 label_preview: Preview
723 724 label_feed_plural: Feeds
724 725 label_changes_details: Details of all changes
725 726 label_issue_tracking: Issue tracking
726 727 label_spent_time: Spent time
727 728 label_overall_spent_time: Overall spent time
728 729 label_f_hour: "%{value} hour"
729 730 label_f_hour_plural: "%{value} hours"
730 731 label_time_tracking: Time tracking
731 732 label_change_plural: Changes
732 733 label_statistics: Statistics
733 734 label_commits_per_month: Commits per month
734 735 label_commits_per_author: Commits per author
735 736 label_diff: diff
736 737 label_view_diff: View differences
737 738 label_diff_inline: inline
738 739 label_diff_side_by_side: side by side
739 740 label_options: Options
740 741 label_copy_workflow_from: Copy workflow from
741 742 label_permissions_report: Permissions report
742 743 label_watched_issues: Watched issues
743 744 label_related_issues: Related issues
744 745 label_applied_status: Applied status
745 746 label_loading: Loading...
746 747 label_relation_new: New relation
747 748 label_relation_delete: Delete relation
748 749 label_relates_to: Related to
749 750 label_duplicates: Duplicates
750 751 label_duplicated_by: Duplicated by
751 752 label_blocks: Blocks
752 753 label_blocked_by: Blocked by
753 754 label_precedes: Precedes
754 755 label_follows: Follows
755 756 label_copied_to: Copied to
756 757 label_copied_from: Copied from
757 758 label_end_to_start: end to start
758 759 label_end_to_end: end to end
759 760 label_start_to_start: start to start
760 761 label_start_to_end: start to end
761 762 label_stay_logged_in: Stay logged in
762 763 label_disabled: disabled
763 764 label_show_completed_versions: Show completed versions
764 765 label_me: me
765 766 label_board: Forum
766 767 label_board_new: New forum
767 768 label_board_plural: Forums
768 769 label_board_locked: Locked
769 770 label_board_sticky: Sticky
770 771 label_topic_plural: Topics
771 772 label_message_plural: Messages
772 773 label_message_last: Last message
773 774 label_message_new: New message
774 775 label_message_posted: Message added
775 776 label_reply_plural: Replies
776 777 label_send_information: Send account information to the user
777 778 label_year: Year
778 779 label_month: Month
779 780 label_week: Week
780 781 label_date_from: From
781 782 label_date_to: To
782 783 label_language_based: Based on user's language
783 784 label_sort_by: "Sort by %{value}"
784 785 label_send_test_email: Send a test email
785 786 label_feeds_access_key: RSS access key
786 787 label_missing_feeds_access_key: Missing a RSS access key
787 788 label_feeds_access_key_created_on: "RSS access key created %{value} ago"
788 789 label_module_plural: Modules
789 790 label_added_time_by: "Added by %{author} %{age} ago"
790 791 label_updated_time_by: "Updated by %{author} %{age} ago"
791 792 label_updated_time: "Updated %{value} ago"
792 793 label_jump_to_a_project: Jump to a project...
793 794 label_file_plural: Files
794 795 label_changeset_plural: Changesets
795 796 label_default_columns: Default columns
796 797 label_no_change_option: (No change)
797 798 label_bulk_edit_selected_issues: Bulk edit selected issues
798 799 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
799 800 label_theme: Theme
800 801 label_default: Default
801 802 label_search_titles_only: Search titles only
802 803 label_user_mail_option_all: "For any event on all my projects"
803 804 label_user_mail_option_selected: "For any event on the selected projects only..."
804 805 label_user_mail_option_none: "No events"
805 806 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
806 807 label_user_mail_option_only_assigned: "Only for things I am assigned to"
807 808 label_user_mail_option_only_owner: "Only for things I am the owner of"
808 809 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
809 810 label_registration_activation_by_email: account activation by email
810 811 label_registration_manual_activation: manual account activation
811 812 label_registration_automatic_activation: automatic account activation
812 813 label_display_per_page: "Per page: %{value}"
813 814 label_age: Age
814 815 label_change_properties: Change properties
815 816 label_general: General
816 817 label_more: More
817 818 label_scm: SCM
818 819 label_plugins: Plugins
819 820 label_ldap_authentication: LDAP authentication
820 821 label_downloads_abbr: D/L
821 822 label_optional_description: Optional description
822 823 label_add_another_file: Add another file
823 824 label_preferences: Preferences
824 825 label_chronological_order: In chronological order
825 826 label_reverse_chronological_order: In reverse chronological order
826 827 label_planning: Planning
827 828 label_incoming_emails: Incoming emails
828 829 label_generate_key: Generate a key
829 830 label_issue_watchers: Watchers
830 831 label_example: Example
831 832 label_display: Display
832 833 label_sort: Sort
833 834 label_ascending: Ascending
834 835 label_descending: Descending
835 836 label_date_from_to: From %{start} to %{end}
836 837 label_wiki_content_added: Wiki page added
837 838 label_wiki_content_updated: Wiki page updated
838 839 label_group: Group
839 840 label_group_plural: Groups
840 841 label_group_new: New group
841 842 label_time_entry_plural: Spent time
842 843 label_version_sharing_none: Not shared
843 844 label_version_sharing_descendants: With subprojects
844 845 label_version_sharing_hierarchy: With project hierarchy
845 846 label_version_sharing_tree: With project tree
846 847 label_version_sharing_system: With all projects
847 848 label_update_issue_done_ratios: Update issue done ratios
848 849 label_copy_source: Source
849 850 label_copy_target: Target
850 851 label_copy_same_as_target: Same as target
851 852 label_display_used_statuses_only: Only display statuses that are used by this tracker
852 853 label_api_access_key: API access key
853 854 label_missing_api_access_key: Missing an API access key
854 855 label_api_access_key_created_on: "API access key created %{value} ago"
855 856 label_profile: Profile
856 857 label_subtask_plural: Subtasks
857 858 label_project_copy_notifications: Send email notifications during the project copy
858 859 label_principal_search: "Search for user or group:"
859 860 label_user_search: "Search for user:"
860 861 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
861 862 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
862 863 label_issues_visibility_all: All issues
863 864 label_issues_visibility_public: All non private issues
864 865 label_issues_visibility_own: Issues created by or assigned to the user
865 866 label_git_report_last_commit: Report last commit for files and directories
866 867 label_parent_revision: Parent
867 868 label_child_revision: Child
868 869 label_export_options: "%{export_format} export options"
869 870 label_copy_attachments: Copy attachments
870 871 label_copy_subtasks: Copy subtasks
871 872 label_item_position: "%{position} of %{count}"
872 873 label_completed_versions: Completed versions
873 874 label_search_for_watchers: Search for watchers to add
874 875 label_session_expiration: Session expiration
875 876 label_show_closed_projects: View closed projects
876 877 label_status_transitions: Status transitions
877 878 label_fields_permissions: Fields permissions
878 879 label_readonly: Read-only
879 880 label_required: Required
880 881 label_attribute_of_project: "Project's %{name}"
881 882 label_attribute_of_author: "Author's %{name}"
882 883 label_attribute_of_assigned_to: "Assignee's %{name}"
883 884 label_attribute_of_fixed_version: "Target version's %{name}"
884 885
885 886 button_login: Login
886 887 button_submit: Submit
887 888 button_save: Save
888 889 button_check_all: Check all
889 890 button_uncheck_all: Uncheck all
890 891 button_collapse_all: Collapse all
891 892 button_expand_all: Expand all
892 893 button_delete: Delete
893 894 button_create: Create
894 895 button_create_and_continue: Create and continue
895 896 button_test: Test
896 897 button_edit: Edit
897 898 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
898 899 button_add: Add
899 900 button_change: Change
900 901 button_apply: Apply
901 902 button_clear: Clear
902 903 button_lock: Lock
903 904 button_unlock: Unlock
904 905 button_download: Download
905 906 button_list: List
906 907 button_view: View
907 908 button_move: Move
908 909 button_move_and_follow: Move and follow
909 910 button_back: Back
910 911 button_cancel: Cancel
911 912 button_activate: Activate
912 913 button_sort: Sort
913 914 button_log_time: Log time
914 915 button_rollback: Rollback to this version
915 916 button_watch: Watch
916 917 button_unwatch: Unwatch
917 918 button_reply: Reply
918 919 button_archive: Archive
919 920 button_unarchive: Unarchive
920 921 button_reset: Reset
921 922 button_rename: Rename
922 923 button_change_password: Change password
923 924 button_copy: Copy
924 925 button_copy_and_follow: Copy and follow
925 926 button_annotate: Annotate
926 927 button_update: Update
927 928 button_configure: Configure
928 929 button_quote: Quote
929 930 button_duplicate: Duplicate
930 931 button_show: Show
931 932 button_edit_section: Edit this section
932 933 button_export: Export
933 934 button_delete_my_account: Delete my account
934 935 button_close: Close
935 936 button_reopen: Reopen
936 937
937 938 status_active: active
938 939 status_registered: registered
939 940 status_locked: locked
940 941
941 942 project_status_active: active
942 943 project_status_closed: closed
943 944 project_status_archived: archived
944 945
945 946 version_status_open: open
946 947 version_status_locked: locked
947 948 version_status_closed: closed
948 949
949 950 field_active: Active
950 951
951 952 text_select_mail_notifications: Select actions for which email notifications should be sent.
952 953 text_regexp_info: eg. ^[A-Z0-9]+$
953 954 text_min_max_length_info: 0 means no restriction
954 955 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
955 956 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
956 957 text_workflow_edit: Select a role and a tracker to edit the workflow
957 958 text_are_you_sure: Are you sure?
958 959 text_are_you_sure_with_children: "Delete issue and all child issues?"
959 960 text_journal_changed: "%{label} changed from %{old} to %{new}"
960 961 text_journal_changed_no_detail: "%{label} updated"
961 962 text_journal_set_to: "%{label} set to %{value}"
962 963 text_journal_deleted: "%{label} deleted (%{old})"
963 964 text_journal_added: "%{label} %{value} added"
964 965 text_tip_issue_begin_day: issue beginning this day
965 966 text_tip_issue_end_day: issue ending this day
966 967 text_tip_issue_begin_end_day: issue beginning and ending this day
967 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 969 text_caracters_maximum: "%{count} characters maximum."
969 970 text_caracters_minimum: "Must be at least %{count} characters long."
970 971 text_length_between: "Length between %{min} and %{max} characters."
971 972 text_tracker_no_workflow: No workflow defined for this tracker
972 973 text_unallowed_characters: Unallowed characters
973 974 text_comma_separated: Multiple values allowed (comma separated).
974 975 text_line_separated: Multiple values allowed (one line for each value).
975 976 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
976 977 text_issue_added: "Issue %{id} has been reported by %{author}."
977 978 text_issue_updated: "Issue %{id} has been updated by %{author}."
978 979 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
979 980 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
980 981 text_issue_category_destroy_assignments: Remove category assignments
981 982 text_issue_category_reassign_to: Reassign issues to this category
982 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 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 985 text_load_default_configuration: Load the default configuration
985 986 text_status_changed_by_changeset: "Applied in changeset %{value}."
986 987 text_time_logged_by_changeset: "Applied in changeset %{value}."
987 988 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
988 989 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
989 990 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
990 991 text_select_project_modules: 'Select modules to enable for this project:'
991 992 text_default_administrator_account_changed: Default administrator account changed
992 993 text_file_repository_writable: Attachments directory writable
993 994 text_plugin_assets_writable: Plugin assets directory writable
994 995 text_rmagick_available: RMagick available (optional)
995 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 997 text_destroy_time_entries: Delete reported hours
997 998 text_assign_time_entries_to_project: Assign reported hours to the project
998 999 text_reassign_time_entries: 'Reassign reported hours to this issue:'
999 1000 text_user_wrote: "%{value} wrote:"
1000 1001 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
1001 1002 text_enumeration_category_reassign_to: 'Reassign them to this value:'
1002 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 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 1005 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
1005 1006 text_custom_field_possible_values_info: 'One line for each value'
1006 1007 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
1007 1008 text_wiki_page_nullify_children: "Keep child pages as root pages"
1008 1009 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
1009 1010 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1010 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 1012 text_zoom_in: Zoom in
1012 1013 text_zoom_out: Zoom out
1013 1014 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1014 1015 text_scm_path_encoding_note: "Default: UTF-8"
1015 1016 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1016 1017 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1017 1018 text_scm_command: Command
1018 1019 text_scm_command_version: Version
1019 1020 text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
1020 1021 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
1021 1022 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1022 1023 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1023 1024 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1024 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 1026 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1026 1027 text_project_closed: This project is closed and read-only.
1027 1028
1028 1029 default_role_manager: Manager
1029 1030 default_role_developer: Developer
1030 1031 default_role_reporter: Reporter
1031 1032 default_tracker_bug: Bug
1032 1033 default_tracker_feature: Feature
1033 1034 default_tracker_support: Support
1034 1035 default_issue_status_new: New
1035 1036 default_issue_status_in_progress: In Progress
1036 1037 default_issue_status_resolved: Resolved
1037 1038 default_issue_status_feedback: Feedback
1038 1039 default_issue_status_closed: Closed
1039 1040 default_issue_status_rejected: Rejected
1040 1041 default_doc_category_user: User documentation
1041 1042 default_doc_category_tech: Technical documentation
1042 1043 default_priority_low: Low
1043 1044 default_priority_normal: Normal
1044 1045 default_priority_high: High
1045 1046 default_priority_urgent: Urgent
1046 1047 default_priority_immediate: Immediate
1047 1048 default_activity_design: Design
1048 1049 default_activity_development: Development
1049 1050
1050 1051 enumeration_issue_priorities: Issue priorities
1051 1052 enumeration_doc_categories: Document categories
1052 1053 enumeration_activities: Activities (time tracking)
1053 1054 enumeration_system_activity: System Activity
1054 1055 description_filter: Filter
1055 1056 description_search: Searchfield
1056 1057 description_choose_project: Projects
1057 1058 description_project_scope: Search scope
1058 1059 description_notes: Notes
1059 1060 description_message_content: Message content
1060 1061 description_query_sort_criteria_attribute: Sort attribute
1061 1062 description_query_sort_criteria_direction: Sort direction
1062 1063 description_user_mail_notification: Mail notification settings
1063 1064 description_available_columns: Available Columns
1064 1065 description_selected_columns: Selected Columns
1065 1066 description_all_columns: All Columns
1066 1067 description_issue_category_reassign: Choose issue category
1067 1068 description_wiki_subpages_reassign: Choose new parent page
1068 1069 description_date_range_list: Choose range from list
1069 1070 description_date_range_interval: Choose range by selecting start and end date
1070 1071 description_date_from: Enter start date
1071 1072 description_date_to: Enter end date
1072 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 1 # French translations for Ruby on Rails
2 2 # by Christian Lescuyer (christian@flyingcoders.com)
3 3 # contributor: Sebastien Grosjean - ZenCocoon.com
4 4 # contributor: Thibaut Cuvelier - Developpez.com
5 5
6 6 fr:
7 7 direction: ltr
8 8 date:
9 9 formats:
10 10 default: "%d/%m/%Y"
11 11 short: "%e %b"
12 12 long: "%e %B %Y"
13 13 long_ordinal: "%e %B %Y"
14 14 only_day: "%e"
15 15
16 16 day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]
17 17 abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam]
18 18 month_names: [~, janvier, fΓ©vrier, mars, avril, mai, juin, juillet, aoΓ»t, septembre, octobre, novembre, dΓ©cembre]
19 19 abbr_month_names: [~, jan., fΓ©v., mar., avr., mai, juin, juil., aoΓ»t, sept., oct., nov., dΓ©c.]
20 20 order:
21 21 - :day
22 22 - :month
23 23 - :year
24 24
25 25 time:
26 26 formats:
27 27 default: "%d/%m/%Y %H:%M"
28 28 time: "%H:%M"
29 29 short: "%d %b %H:%M"
30 30 long: "%A %d %B %Y %H:%M:%S %Z"
31 31 long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
32 32 only_second: "%S"
33 33 am: 'am'
34 34 pm: 'pm'
35 35
36 36 datetime:
37 37 distance_in_words:
38 38 half_a_minute: "30 secondes"
39 39 less_than_x_seconds:
40 40 zero: "moins d'une seconde"
41 41 one: "moins d'uneΒ seconde"
42 42 other: "moins de %{count}Β secondes"
43 43 x_seconds:
44 44 one: "1Β seconde"
45 45 other: "%{count}Β secondes"
46 46 less_than_x_minutes:
47 47 zero: "moins d'une minute"
48 48 one: "moins d'uneΒ minute"
49 49 other: "moins de %{count}Β minutes"
50 50 x_minutes:
51 51 one: "1Β minute"
52 52 other: "%{count}Β minutes"
53 53 about_x_hours:
54 54 one: "environ une heure"
55 55 other: "environ %{count}Β heures"
56 56 x_hours:
57 57 one: "une heure"
58 58 other: "%{count}Β heures"
59 59 x_days:
60 60 one: "unΒ jour"
61 61 other: "%{count}Β jours"
62 62 about_x_months:
63 63 one: "environ un mois"
64 64 other: "environ %{count}Β mois"
65 65 x_months:
66 66 one: "unΒ mois"
67 67 other: "%{count}Β mois"
68 68 about_x_years:
69 69 one: "environ un an"
70 70 other: "environ %{count}Β ans"
71 71 over_x_years:
72 72 one: "plus d'un an"
73 73 other: "plus de %{count}Β ans"
74 74 almost_x_years:
75 75 one: "presqu'un an"
76 76 other: "presque %{count} ans"
77 77 prompts:
78 78 year: "AnnΓ©e"
79 79 month: "Mois"
80 80 day: "Jour"
81 81 hour: "Heure"
82 82 minute: "Minute"
83 83 second: "Seconde"
84 84
85 85 number:
86 86 format:
87 87 precision: 3
88 88 separator: ','
89 89 delimiter: 'Β '
90 90 currency:
91 91 format:
92 92 unit: '€'
93 93 precision: 2
94 94 format: '%nΒ %u'
95 95 human:
96 96 format:
97 97 precision: 3
98 98 storage_units:
99 99 format: "%n %u"
100 100 units:
101 101 byte:
102 102 one: "octet"
103 103 other: "octet"
104 104 kb: "ko"
105 105 mb: "Mo"
106 106 gb: "Go"
107 107 tb: "To"
108 108
109 109 support:
110 110 array:
111 111 sentence_connector: 'et'
112 112 skip_last_comma: true
113 113 word_connector: ", "
114 114 two_words_connector: " et "
115 115 last_word_connector: " et "
116 116
117 117 activerecord:
118 118 errors:
119 119 template:
120 120 header:
121 121 one: "Impossible d'enregistrer %{model} : une erreur"
122 122 other: "Impossible d'enregistrer %{model} : %{count} erreurs."
123 123 body: "Veuillez vΓ©rifier les champs suivantsΒ :"
124 124 messages:
125 125 inclusion: "n'est pas inclus(e) dans la liste"
126 126 exclusion: "n'est pas disponible"
127 127 invalid: "n'est pas valide"
128 128 confirmation: "ne concorde pas avec la confirmation"
129 129 accepted: "doit Γͺtre acceptΓ©(e)"
130 130 empty: "doit Γͺtre renseignΓ©(e)"
131 131 blank: "doit Γͺtre renseignΓ©(e)"
132 132 too_long: "est trop long (pas plus de %{count} caractères)"
133 133 too_short: "est trop court (au moins %{count} caractères)"
134 134 wrong_length: "ne fait pas la bonne longueur (doit comporter %{count} caractères)"
135 135 taken: "est dΓ©jΓ  utilisΓ©"
136 136 not_a_number: "n'est pas un nombre"
137 137 not_a_date: "n'est pas une date valide"
138 138 greater_than: "doit Γͺtre supΓ©rieur Γ  %{count}"
139 139 greater_than_or_equal_to: "doit Γͺtre supΓ©rieur ou Γ©gal Γ  %{count}"
140 140 equal_to: "doit Γͺtre Γ©gal Γ  %{count}"
141 141 less_than: "doit Γͺtre infΓ©rieur Γ  %{count}"
142 142 less_than_or_equal_to: "doit Γͺtre infΓ©rieur ou Γ©gal Γ  %{count}"
143 143 odd: "doit Γͺtre impair"
144 144 even: "doit Γͺtre pair"
145 145 greater_than_start_date: "doit Γͺtre postΓ©rieure Γ  la date de dΓ©but"
146 146 not_same_project: "n'appartient pas au mΓͺme projet"
147 147 circular_dependency: "Cette relation crΓ©erait une dΓ©pendance circulaire"
148 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 150 actionview_instancetag_blank_option: Choisir
151 151
152 152 general_text_No: 'Non'
153 153 general_text_Yes: 'Oui'
154 154 general_text_no: 'non'
155 155 general_text_yes: 'oui'
156 156 general_lang_name: 'FranΓ§ais'
157 157 general_csv_separator: ';'
158 158 general_csv_decimal_separator: ','
159 159 general_csv_encoding: ISO-8859-1
160 160 general_pdf_encoding: UTF-8
161 161 general_first_day_of_week: '1'
162 162
163 163 notice_account_updated: Le compte a été mis à jour avec succès.
164 164 notice_account_invalid_creditentials: Identifiant ou mot de passe invalide.
165 165 notice_account_password_updated: Mot de passe mis à jour avec succès.
166 166 notice_account_wrong_password: Mot de passe incorrect
167 167 notice_account_register_done: Un message contenant les instructions pour activer votre compte vous a Γ©tΓ© envoyΓ©.
168 168 notice_account_unknown_email: Aucun compte ne correspond Γ  cette adresse.
169 169 notice_can_t_change_password: Ce compte utilise une authentification externe. Impossible de changer le mot de passe.
170 170 notice_account_lost_email_sent: Un message contenant les instructions pour choisir un nouveau mot de passe vous a Γ©tΓ© envoyΓ©.
171 171 notice_account_activated: Votre compte a Γ©tΓ© activΓ©. Vous pouvez Γ  prΓ©sent vous connecter.
172 172 notice_successful_create: Création effectuée avec succès.
173 173 notice_successful_update: Mise à jour effectuée avec succès.
174 174 notice_successful_delete: Suppression effectuée avec succès.
175 175 notice_successful_connection: Connexion rΓ©ussie.
176 176 notice_file_not_found: "La page Γ  laquelle vous souhaitez accΓ©der n'existe pas ou a Γ©tΓ© supprimΓ©e."
177 177 notice_locking_conflict: Les donnΓ©es ont Γ©tΓ© mises Γ  jour par un autre utilisateur. Mise Γ  jour impossible.
178 178 notice_not_authorized: "Vous n'Γͺtes pas autorisΓ© Γ  accΓ©der Γ  cette page."
179 179 notice_not_authorized_archived_project: Le projet auquel vous tentez d'accΓ©der a Γ©tΓ© archivΓ©.
180 180 notice_email_sent: "Un email a Γ©tΓ© envoyΓ© Γ  %{value}"
181 181 notice_email_error: "Erreur lors de l'envoi de l'email (%{value})"
182 182 notice_feeds_access_key_reseted: "Votre clé d'accès aux flux RSS a été réinitialisée."
183 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 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 185 notice_no_issue_selected: "Aucune demande sΓ©lectionnΓ©e ! Cochez les demandes que vous voulez mettre Γ  jour."
186 186 notice_account_pending: "Votre compte a été créé et attend l'approbation de l'administrateur."
187 187 notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
188 188 notice_unable_delete_version: Impossible de supprimer cette version.
189 189 notice_issue_done_ratios_updated: L'avancement des demandes a Γ©tΓ© mis Γ  jour.
190 190 notice_api_access_key_reseted: Votre clé d'accès API a été réinitialisée.
191 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 192 notice_issue_successful_create: "Demande %{id} créée."
193 193 notice_issue_update_conflict: "La demande a Γ©tΓ© mise Γ  jour par un autre utilisateur pendant que vous la modifiez."
194 194 notice_account_deleted: "Votre compte a Γ©tΓ© dΓ©finitivement supprimΓ©."
195 195 notice_user_successful_create: "Utilisateur %{id} créé."
196 196
197 197 error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramΓ©trage : %{value}"
198 198 error_scm_not_found: "L'entrΓ©e et/ou la rΓ©vision demandΓ©e n'existe pas dans le dΓ©pΓ΄t."
199 199 error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt : %{value}"
200 200 error_scm_annotate: "L'entrΓ©e n'existe pas ou ne peut pas Γͺtre annotΓ©e."
201 201 error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas Γ  ce projet"
202 202 error_can_not_reopen_issue_on_closed_version: 'Une demande assignΓ©e Γ  une version fermΓ©e ne peut pas Γͺtre rΓ©ouverte'
203 203 error_can_not_archive_project: "Ce projet ne peut pas Γͺtre archivΓ©"
204 204 error_workflow_copy_source: 'Veuillez sΓ©lectionner un tracker et/ou un rΓ΄le source'
205 205 error_workflow_copy_target: 'Veuillez sΓ©lectionner les trackers et rΓ΄les cibles'
206 206 error_issue_done_ratios_not_updated: L'avancement des demandes n'a pas pu Γͺtre mis Γ  jour.
207 207 error_attachment_too_big: Ce fichier ne peut pas Γͺtre attachΓ© car il excΓ¨de la taille maximale autorisΓ©e (%{max_size})
208 208 error_session_expired: "Votre session a expirΓ©. Veuillez vous reconnecter."
209 209
210 210 warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu Γͺtre sauvegardΓ©s."
211 211
212 212 mail_subject_lost_password: "Votre mot de passe %{value}"
213 213 mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
214 214 mail_subject_register: "Activation de votre compte %{value}"
215 215 mail_body_register: 'Pour activer votre compte, cliquez sur le lien suivant :'
216 216 mail_body_account_information_external: "Vous pouvez utiliser votre compte %{value} pour vous connecter."
217 217 mail_body_account_information: Paramètres de connexion de votre compte
218 218 mail_subject_account_activation_request: "Demande d'activation d'un compte %{value}"
219 219 mail_body_account_activation_request: "Un nouvel utilisateur (%{value}) s'est inscrit. Son compte nΓ©cessite votre approbation :"
220 220 mail_subject_reminder: "%{count} demande(s) arrivent Γ  Γ©chΓ©ance (%{days})"
221 221 mail_body_reminder: "%{count} demande(s) qui vous sont assignΓ©es arrivent Γ  Γ©chΓ©ance dans les %{days} prochains jours :"
222 222 mail_subject_wiki_content_added: "Page wiki '%{id}' ajoutΓ©e"
223 223 mail_body_wiki_content_added: "La page wiki '%{id}' a Γ©tΓ© ajoutΓ©e par %{author}."
224 224 mail_subject_wiki_content_updated: "Page wiki '%{id}' mise Γ  jour"
225 225 mail_body_wiki_content_updated: "La page wiki '%{id}' a Γ©tΓ© mise Γ  jour par %{author}."
226 226
227 227 gui_validation_error: 1 erreur
228 228 gui_validation_error_plural: "%{count} erreurs"
229 229
230 230 field_name: Nom
231 231 field_description: Description
232 232 field_summary: RΓ©sumΓ©
233 233 field_is_required: Obligatoire
234 234 field_firstname: PrΓ©nom
235 235 field_lastname: Nom
236 236 field_mail: "Email "
237 237 field_filename: Fichier
238 238 field_filesize: Taille
239 239 field_downloads: TΓ©lΓ©chargements
240 240 field_author: Auteur
241 241 field_created_on: "Créé "
242 242 field_updated_on: "Mis-Γ -jour "
243 243 field_field_format: Format
244 244 field_is_for_all: Pour tous les projets
245 245 field_possible_values: Valeurs possibles
246 246 field_regexp: Expression régulière
247 247 field_min_length: Longueur minimum
248 248 field_max_length: Longueur maximum
249 249 field_value: Valeur
250 250 field_category: CatΓ©gorie
251 251 field_title: Titre
252 252 field_project: Projet
253 253 field_issue: Demande
254 254 field_status: Statut
255 255 field_notes: Notes
256 256 field_is_closed: Demande fermΓ©e
257 257 field_is_default: Valeur par dΓ©faut
258 258 field_tracker: Tracker
259 259 field_subject: Sujet
260 260 field_due_date: EchΓ©ance
261 261 field_assigned_to: AssignΓ© Γ 
262 262 field_priority: PrioritΓ©
263 263 field_fixed_version: Version cible
264 264 field_user: Utilisateur
265 265 field_role: RΓ΄le
266 266 field_homepage: "Site web "
267 267 field_is_public: Public
268 268 field_parent: Sous-projet de
269 269 field_is_in_roadmap: Demandes affichΓ©es dans la roadmap
270 270 field_login: "Identifiant "
271 271 field_mail_notification: Notifications par mail
272 272 field_admin: Administrateur
273 273 field_last_login_on: "Dernière connexion "
274 274 field_language: Langue
275 275 field_effective_date: Date
276 276 field_password: Mot de passe
277 277 field_new_password: Nouveau mot de passe
278 278 field_password_confirmation: Confirmation
279 279 field_version: Version
280 280 field_type: Type
281 281 field_host: HΓ΄te
282 282 field_port: Port
283 283 field_account: Compte
284 284 field_base_dn: Base DN
285 285 field_attr_login: Attribut Identifiant
286 286 field_attr_firstname: Attribut PrΓ©nom
287 287 field_attr_lastname: Attribut Nom
288 288 field_attr_mail: Attribut Email
289 289 field_onthefly: CrΓ©ation des utilisateurs Γ  la volΓ©e
290 290 field_start_date: DΓ©but
291 291 field_done_ratio: "% rΓ©alisΓ©"
292 292 field_auth_source: Mode d'authentification
293 293 field_hide_mail: Cacher mon adresse mail
294 294 field_comments: Commentaire
295 295 field_url: URL
296 296 field_start_page: Page de dΓ©marrage
297 297 field_subproject: Sous-projet
298 298 field_hours: Heures
299 299 field_activity: ActivitΓ©
300 300 field_spent_on: Date
301 301 field_identifier: Identifiant
302 302 field_is_filter: UtilisΓ© comme filtre
303 303 field_issue_to: Demande liΓ©e
304 304 field_delay: Retard
305 305 field_assignable: Demandes assignables Γ  ce rΓ΄le
306 306 field_redirect_existing_links: Rediriger les liens existants
307 307 field_estimated_hours: Temps estimΓ©
308 308 field_column_names: Colonnes
309 309 field_time_zone: Fuseau horaire
310 310 field_searchable: UtilisΓ© pour les recherches
311 311 field_default_value: Valeur par dΓ©faut
312 312 field_comments_sorting: Afficher les commentaires
313 313 field_parent_title: Page parent
314 314 field_editable: Modifiable
315 315 field_watcher: Observateur
316 316 field_identity_url: URL OpenID
317 317 field_content: Contenu
318 318 field_group_by: Grouper par
319 319 field_sharing: Partage
320 320 field_active: Actif
321 321 field_parent_issue: TΓ’che parente
322 322 field_visible: Visible
323 323 field_warn_on_leaving_unsaved: "M'avertir lorsque je quitte une page contenant du texte non sauvegardΓ©"
324 324 field_issues_visibility: VisibilitΓ© des demandes
325 325 field_is_private: PrivΓ©e
326 326 field_commit_logs_encoding: Encodage des messages de commit
327 327 field_repository_is_default: DΓ©pΓ΄t principal
328 328 field_multiple: Valeurs multiples
329 329 field_auth_source_ldap_filter: Filtre LDAP
330 330 field_core_fields: Champs standards
331 331 field_timeout: "Timeout (en secondes)"
332 332 field_board_parent: Forum parent
333 333 field_private_notes: Notes privΓ©es
334 334
335 335 setting_app_title: Titre de l'application
336 336 setting_app_subtitle: Sous-titre de l'application
337 337 setting_welcome_text: Texte d'accueil
338 338 setting_default_language: Langue par dΓ©faut
339 339 setting_login_required: Authentification obligatoire
340 340 setting_self_registration: Inscription des nouveaux utilisateurs
341 341 setting_attachment_max_size: Taille maximale des fichiers
342 342 setting_issues_export_limit: Limite d'exportation des demandes
343 343 setting_mail_from: Adresse d'Γ©mission
344 344 setting_bcc_recipients: Destinataires en copie cachΓ©e (cci)
345 345 setting_plain_text_mail: Mail en texte brut (non HTML)
346 346 setting_host_name: Nom d'hΓ΄te et chemin
347 347 setting_text_formatting: Formatage du texte
348 348 setting_wiki_compression: Compression de l'historique des pages wiki
349 349 setting_feeds_limit: Nombre maximal d'Γ©lΓ©ments dans les flux Atom
350 350 setting_default_projects_public: DΓ©finir les nouveaux projets comme publics par dΓ©faut
351 351 setting_autofetch_changesets: RΓ©cupΓ©ration automatique des commits
352 352 setting_sys_api_enabled: Activer les WS pour la gestion des dΓ©pΓ΄ts
353 353 setting_commit_ref_keywords: Mots-clΓ©s de rΓ©fΓ©rencement
354 354 setting_commit_fix_keywords: Mots-clΓ©s de rΓ©solution
355 355 setting_autologin: DurΓ©e maximale de connexion automatique
356 356 setting_date_format: Format de date
357 357 setting_time_format: Format d'heure
358 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 360 setting_issue_list_default_columns: Colonnes affichΓ©es par dΓ©faut sur la liste des demandes
360 361 setting_emails_footer: Pied-de-page des emails
361 362 setting_protocol: Protocole
362 363 setting_per_page_options: Options d'objets affichΓ©s par page
363 364 setting_user_format: Format d'affichage des utilisateurs
364 365 setting_activity_days_default: Nombre de jours affichΓ©s sur l'activitΓ© des projets
365 366 setting_display_subprojects_issues: Afficher par dΓ©faut les demandes des sous-projets sur les projets principaux
366 367 setting_enabled_scm: SCM activΓ©s
367 368 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
368 369 setting_mail_handler_api_enabled: "Activer le WS pour la rΓ©ception d'emails"
369 370 setting_mail_handler_api_key: ClΓ© de protection de l'API
370 371 setting_sequential_project_identifiers: GΓ©nΓ©rer des identifiants de projet sΓ©quentiels
371 372 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
372 373 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichΓ©es
373 374 setting_file_max_size_displayed: Taille maximum des fichiers texte affichΓ©s en ligne
374 375 setting_repository_log_display_limit: "Nombre maximum de rΓ©visions affichΓ©es sur l'historique d'un fichier"
375 376 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
376 377 setting_password_min_length: Longueur minimum des mots de passe
377 378 setting_new_project_user_role_id: RΓ΄le donnΓ© Γ  un utilisateur non-administrateur qui crΓ©e un projet
378 379 setting_default_projects_modules: Modules activΓ©s par dΓ©faut pour les nouveaux projets
379 380 setting_issue_done_ratio: Calcul de l'avancement des demandes
380 381 setting_issue_done_ratio_issue_status: Utiliser le statut
381 382 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectuΓ©'
382 383 setting_rest_api_enabled: Activer l'API REST
383 384 setting_gravatar_default: Image Gravatar par dΓ©faut
384 385 setting_start_of_week: Jour de dΓ©but des calendriers
385 386 setting_cache_formatted_text: Mettre en cache le texte formatΓ©
386 387 setting_commit_logtime_enabled: Permettre la saisie de temps
387 388 setting_commit_logtime_activity_id: ActivitΓ© pour le temps saisi
388 389 setting_gantt_items_limit: Nombre maximum d'Γ©lΓ©ments affichΓ©s sur le gantt
389 390 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
390 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 392 setting_commit_cross_project_ref: Permettre le rΓ©fΓ©rencement et la rΓ©solution des demandes de tous les autres projets
392 393 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
393 394 setting_session_lifetime: DurΓ©e de vie maximale des sessions
394 395 setting_session_timeout: DurΓ©e maximale d'inactivitΓ©
395 396 setting_thumbnails_enabled: Afficher les vignettes des images
396 397 setting_thumbnails_size: Taille des vignettes (en pixels)
397 398
398 399 permission_add_project: CrΓ©er un projet
399 400 permission_add_subprojects: CrΓ©er des sous-projets
400 401 permission_edit_project: Modifier le projet
401 402 permission_close_project: Fermer / rΓ©ouvrir le projet
402 403 permission_select_project_modules: Choisir les modules
403 404 permission_manage_members: GΓ©rer les membres
404 405 permission_manage_versions: GΓ©rer les versions
405 406 permission_manage_categories: GΓ©rer les catΓ©gories de demandes
406 407 permission_view_issues: Voir les demandes
407 408 permission_add_issues: CrΓ©er des demandes
408 409 permission_edit_issues: Modifier les demandes
409 410 permission_manage_issue_relations: GΓ©rer les relations
410 411 permission_set_issues_private: Rendre les demandes publiques ou privΓ©es
411 412 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privΓ©es
412 413 permission_add_issue_notes: Ajouter des notes
413 414 permission_edit_issue_notes: Modifier les notes
414 415 permission_edit_own_issue_notes: Modifier ses propres notes
415 416 permission_view_private_notes: Voir les notes privΓ©es
416 417 permission_set_notes_private: Rendre les notes privΓ©es
417 418 permission_move_issues: DΓ©placer les demandes
418 419 permission_delete_issues: Supprimer les demandes
419 420 permission_manage_public_queries: GΓ©rer les requΓͺtes publiques
420 421 permission_save_queries: Sauvegarder les requΓͺtes
421 422 permission_view_gantt: Voir le gantt
422 423 permission_view_calendar: Voir le calendrier
423 424 permission_view_issue_watchers: Voir la liste des observateurs
424 425 permission_add_issue_watchers: Ajouter des observateurs
425 426 permission_delete_issue_watchers: Supprimer des observateurs
426 427 permission_log_time: Saisir le temps passΓ©
427 428 permission_view_time_entries: Voir le temps passΓ©
428 429 permission_edit_time_entries: Modifier les temps passΓ©s
429 430 permission_edit_own_time_entries: Modifier son propre temps passΓ©
430 431 permission_manage_news: GΓ©rer les annonces
431 432 permission_comment_news: Commenter les annonces
432 433 permission_manage_documents: GΓ©rer les documents
433 434 permission_view_documents: Voir les documents
434 435 permission_manage_files: GΓ©rer les fichiers
435 436 permission_view_files: Voir les fichiers
436 437 permission_manage_wiki: GΓ©rer le wiki
437 438 permission_rename_wiki_pages: Renommer les pages
438 439 permission_delete_wiki_pages: Supprimer les pages
439 440 permission_view_wiki_pages: Voir le wiki
440 441 permission_view_wiki_edits: "Voir l'historique des modifications"
441 442 permission_edit_wiki_pages: Modifier les pages
442 443 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
443 444 permission_protect_wiki_pages: ProtΓ©ger les pages
444 445 permission_manage_repository: GΓ©rer le dΓ©pΓ΄t de sources
445 446 permission_browse_repository: Parcourir les sources
446 447 permission_view_changesets: Voir les rΓ©visions
447 448 permission_commit_access: Droit de commit
448 449 permission_manage_boards: GΓ©rer les forums
449 450 permission_view_messages: Voir les messages
450 451 permission_add_messages: Poster un message
451 452 permission_edit_messages: Modifier les messages
452 453 permission_edit_own_messages: Modifier ses propres messages
453 454 permission_delete_messages: Supprimer les messages
454 455 permission_delete_own_messages: Supprimer ses propres messages
455 456 permission_export_wiki_pages: Exporter les pages
456 457 permission_manage_project_activities: GΓ©rer les activitΓ©s
457 458 permission_manage_subtasks: GΓ©rer les sous-tΓ’ches
458 459 permission_manage_related_issues: GΓ©rer les demandes associΓ©es
459 460
460 461 project_module_issue_tracking: Suivi des demandes
461 462 project_module_time_tracking: Suivi du temps passΓ©
462 463 project_module_news: Publication d'annonces
463 464 project_module_documents: Publication de documents
464 465 project_module_files: Publication de fichiers
465 466 project_module_wiki: Wiki
466 467 project_module_repository: DΓ©pΓ΄t de sources
467 468 project_module_boards: Forums de discussion
468 469
469 470 label_user: Utilisateur
470 471 label_user_plural: Utilisateurs
471 472 label_user_new: Nouvel utilisateur
472 473 label_user_anonymous: Anonyme
473 474 label_project: Projet
474 475 label_project_new: Nouveau projet
475 476 label_project_plural: Projets
476 477 label_x_projects:
477 478 zero: aucun projet
478 479 one: un projet
479 480 other: "%{count} projets"
480 481 label_project_all: Tous les projets
481 482 label_project_latest: Derniers projets
482 483 label_issue: Demande
483 484 label_issue_new: Nouvelle demande
484 485 label_issue_plural: Demandes
485 486 label_issue_view_all: Voir toutes les demandes
486 487 label_issue_added: Demande ajoutΓ©e
487 488 label_issue_updated: Demande mise Γ  jour
488 489 label_issue_note_added: Note ajoutΓ©e
489 490 label_issue_status_updated: Statut changΓ©
490 491 label_issue_priority_updated: PrioritΓ© changΓ©e
491 492 label_issues_by: "Demandes par %{value}"
492 493 label_document: Document
493 494 label_document_new: Nouveau document
494 495 label_document_plural: Documents
495 496 label_document_added: Document ajoutΓ©
496 497 label_role: RΓ΄le
497 498 label_role_plural: RΓ΄les
498 499 label_role_new: Nouveau rΓ΄le
499 500 label_role_and_permissions: RΓ΄les et permissions
500 501 label_role_anonymous: Anonyme
501 502 label_role_non_member: Non membre
502 503 label_member: Membre
503 504 label_member_new: Nouveau membre
504 505 label_member_plural: Membres
505 506 label_tracker: Tracker
506 507 label_tracker_plural: Trackers
507 508 label_tracker_new: Nouveau tracker
508 509 label_workflow: Workflow
509 510 label_issue_status: Statut de demandes
510 511 label_issue_status_plural: Statuts de demandes
511 512 label_issue_status_new: Nouveau statut
512 513 label_issue_category: CatΓ©gorie de demandes
513 514 label_issue_category_plural: CatΓ©gories de demandes
514 515 label_issue_category_new: Nouvelle catΓ©gorie
515 516 label_custom_field: Champ personnalisΓ©
516 517 label_custom_field_plural: Champs personnalisΓ©s
517 518 label_custom_field_new: Nouveau champ personnalisΓ©
518 519 label_enumerations: Listes de valeurs
519 520 label_enumeration_new: Nouvelle valeur
520 521 label_information: Information
521 522 label_information_plural: Informations
522 523 label_please_login: Identification
523 524 label_register: S'enregistrer
524 525 label_login_with_open_id_option: S'authentifier avec OpenID
525 526 label_password_lost: Mot de passe perdu
526 527 label_home: Accueil
527 528 label_my_page: Ma page
528 529 label_my_account: Mon compte
529 530 label_my_projects: Mes projets
530 531 label_my_page_block: Blocs disponibles
531 532 label_administration: Administration
532 533 label_login: Connexion
533 534 label_logout: DΓ©connexion
534 535 label_help: Aide
535 536 label_reported_issues: "Demandes soumises "
536 537 label_assigned_to_me_issues: Demandes qui me sont assignΓ©es
537 538 label_last_login: "Dernière connexion "
538 539 label_registered_on: "Inscrit le "
539 540 label_activity: ActivitΓ©
540 541 label_overall_activity: ActivitΓ© globale
541 542 label_user_activity: "ActivitΓ© de %{value}"
542 543 label_new: Nouveau
543 544 label_logged_as: ConnectΓ© en tant que
544 545 label_environment: Environnement
545 546 label_authentication: Authentification
546 547 label_auth_source: Mode d'authentification
547 548 label_auth_source_new: Nouveau mode d'authentification
548 549 label_auth_source_plural: Modes d'authentification
549 550 label_subproject_plural: Sous-projets
550 551 label_subproject_new: Nouveau sous-projet
551 552 label_and_its_subprojects: "%{value} et ses sous-projets"
552 553 label_min_max_length: Longueurs mini - maxi
553 554 label_list: Liste
554 555 label_date: Date
555 556 label_integer: Entier
556 557 label_float: Nombre dΓ©cimal
557 558 label_boolean: BoolΓ©en
558 559 label_string: Texte
559 560 label_text: Texte long
560 561 label_attribute: Attribut
561 562 label_attribute_plural: Attributs
562 563 label_download: "%{count} tΓ©lΓ©chargement"
563 564 label_download_plural: "%{count} tΓ©lΓ©chargements"
564 565 label_no_data: Aucune donnΓ©e Γ  afficher
565 566 label_change_status: Changer le statut
566 567 label_history: Historique
567 568 label_attachment: Fichier
568 569 label_attachment_new: Nouveau fichier
569 570 label_attachment_delete: Supprimer le fichier
570 571 label_attachment_plural: Fichiers
571 572 label_file_added: Fichier ajoutΓ©
572 573 label_report: Rapport
573 574 label_report_plural: Rapports
574 575 label_news: Annonce
575 576 label_news_new: Nouvelle annonce
576 577 label_news_plural: Annonces
577 578 label_news_latest: Dernières annonces
578 579 label_news_view_all: Voir toutes les annonces
579 580 label_news_added: Annonce ajoutΓ©e
580 581 label_news_comment_added: Commentaire ajoutΓ© Γ  une annonce
581 582 label_settings: Configuration
582 583 label_overview: AperΓ§u
583 584 label_version: Version
584 585 label_version_new: Nouvelle version
585 586 label_version_plural: Versions
586 587 label_confirmation: Confirmation
587 588 label_export_to: 'Formats disponibles :'
588 589 label_read: Lire...
589 590 label_public_projects: Projets publics
590 591 label_open_issues: ouvert
591 592 label_open_issues_plural: ouverts
592 593 label_closed_issues: fermΓ©
593 594 label_closed_issues_plural: fermΓ©s
594 595 label_x_open_issues_abbr_on_total:
595 596 zero: 0 ouverte sur %{total}
596 597 one: 1 ouverte sur %{total}
597 598 other: "%{count} ouvertes sur %{total}"
598 599 label_x_open_issues_abbr:
599 600 zero: 0 ouverte
600 601 one: 1 ouverte
601 602 other: "%{count} ouvertes"
602 603 label_x_closed_issues_abbr:
603 604 zero: 0 fermΓ©e
604 605 one: 1 fermΓ©e
605 606 other: "%{count} fermΓ©es"
606 607 label_x_issues:
607 608 zero: 0 demande
608 609 one: 1 demande
609 610 other: "%{count} demandes"
610 611 label_total: Total
611 612 label_permissions: Permissions
612 613 label_current_status: Statut actuel
613 614 label_new_statuses_allowed: Nouveaux statuts autorisΓ©s
614 615 label_all: tous
615 616 label_any: tous
616 617 label_none: aucun
617 618 label_nobody: personne
618 619 label_next: Suivant
619 620 label_previous: PrΓ©cΓ©dent
620 621 label_used_by: UtilisΓ© par
621 622 label_details: DΓ©tails
622 623 label_add_note: Ajouter une note
623 624 label_per_page: Par page
624 625 label_calendar: Calendrier
625 626 label_months_from: mois depuis
626 627 label_gantt: Gantt
627 628 label_internal: Interne
628 629 label_last_changes: "%{count} derniers changements"
629 630 label_change_view_all: Voir tous les changements
630 631 label_personalize_page: Personnaliser cette page
631 632 label_comment: Commentaire
632 633 label_comment_plural: Commentaires
633 634 label_x_comments:
634 635 zero: aucun commentaire
635 636 one: un commentaire
636 637 other: "%{count} commentaires"
637 638 label_comment_add: Ajouter un commentaire
638 639 label_comment_added: Commentaire ajoutΓ©
639 640 label_comment_delete: Supprimer les commentaires
640 641 label_query: Rapport personnalisΓ©
641 642 label_query_plural: Rapports personnalisΓ©s
642 643 label_query_new: Nouveau rapport
643 644 label_my_queries: Mes rapports personnalisΓ©s
644 645 label_filter_add: "Ajouter le filtre "
645 646 label_filter_plural: Filtres
646 647 label_equals: Γ©gal
647 648 label_not_equals: diffΓ©rent
648 649 label_in_less_than: dans moins de
649 650 label_in_more_than: dans plus de
650 651 label_in: dans
651 652 label_today: aujourd'hui
652 653 label_all_time: toute la pΓ©riode
653 654 label_yesterday: hier
654 655 label_this_week: cette semaine
655 656 label_last_week: la semaine dernière
656 657 label_last_n_weeks: "les %{count} dernières semaines"
657 658 label_last_n_days: "les %{count} derniers jours"
658 659 label_this_month: ce mois-ci
659 660 label_last_month: le mois dernier
660 661 label_this_year: cette annΓ©e
661 662 label_date_range: PΓ©riode
662 663 label_less_than_ago: il y a moins de
663 664 label_more_than_ago: il y a plus de
664 665 label_ago: il y a
665 666 label_contains: contient
666 667 label_not_contains: ne contient pas
667 668 label_any_issues_in_project: une demande du projet
668 669 label_any_issues_not_in_project: une demande hors du projet
669 670 label_no_issues_in_project: aucune demande du projet
670 671 label_day_plural: jours
671 672 label_repository: DΓ©pΓ΄t
672 673 label_repository_new: Nouveau dΓ©pΓ΄t
673 674 label_repository_plural: DΓ©pΓ΄ts
674 675 label_browse: Parcourir
675 676 label_modification: "%{count} modification"
676 677 label_modification_plural: "%{count} modifications"
677 678 label_revision: "RΓ©vision "
678 679 label_revision_plural: RΓ©visions
679 680 label_associated_revisions: RΓ©visions associΓ©es
680 681 label_added: ajoutΓ©
681 682 label_modified: modifiΓ©
682 683 label_copied: copiΓ©
683 684 label_renamed: renommΓ©
684 685 label_deleted: supprimΓ©
685 686 label_latest_revision: Dernière révision
686 687 label_latest_revision_plural: Dernières révisions
687 688 label_view_revisions: Voir les rΓ©visions
688 689 label_max_size: Taille maximale
689 690 label_sort_highest: Remonter en premier
690 691 label_sort_higher: Remonter
691 692 label_sort_lower: Descendre
692 693 label_sort_lowest: Descendre en dernier
693 694 label_roadmap: Roadmap
694 695 label_roadmap_due_in: "Γ‰chΓ©ance dans %{value}"
695 696 label_roadmap_overdue: "En retard de %{value}"
696 697 label_roadmap_no_issues: Aucune demande pour cette version
697 698 label_search: "Recherche "
698 699 label_result_plural: RΓ©sultats
699 700 label_all_words: Tous les mots
700 701 label_wiki: Wiki
701 702 label_wiki_edit: RΓ©vision wiki
702 703 label_wiki_edit_plural: RΓ©visions wiki
703 704 label_wiki_page: Page wiki
704 705 label_wiki_page_plural: Pages wiki
705 706 label_index_by_title: Index par titre
706 707 label_index_by_date: Index par date
707 708 label_current_version: Version actuelle
708 709 label_preview: PrΓ©visualisation
709 710 label_feed_plural: Flux RSS
710 711 label_changes_details: DΓ©tails de tous les changements
711 712 label_issue_tracking: Suivi des demandes
712 713 label_spent_time: Temps passΓ©
713 714 label_f_hour: "%{value} heure"
714 715 label_f_hour_plural: "%{value} heures"
715 716 label_time_tracking: Suivi du temps
716 717 label_change_plural: Changements
717 718 label_statistics: Statistiques
718 719 label_commits_per_month: Commits par mois
719 720 label_commits_per_author: Commits par auteur
720 721 label_view_diff: Voir les diffΓ©rences
721 722 label_diff_inline: en ligne
722 723 label_diff_side_by_side: cΓ΄te Γ  cΓ΄te
723 724 label_options: Options
724 725 label_copy_workflow_from: Copier le workflow de
725 726 label_permissions_report: Synthèse des permissions
726 727 label_watched_issues: Demandes surveillΓ©es
727 728 label_related_issues: Demandes liΓ©es
728 729 label_applied_status: Statut appliquΓ©
729 730 label_loading: Chargement...
730 731 label_relation_new: Nouvelle relation
731 732 label_relation_delete: Supprimer la relation
732 733 label_relates_to: LiΓ© Γ 
733 734 label_duplicates: Duplique
734 735 label_duplicated_by: DupliquΓ© par
735 736 label_blocks: Bloque
736 737 label_blocked_by: BloquΓ© par
737 738 label_precedes: Précède
738 739 label_follows: Suit
739 740 label_copied_to: CopiΓ© vers
740 741 label_copied_from: CopiΓ© depuis
741 742 label_end_to_start: fin Γ  dΓ©but
742 743 label_end_to_end: fin Γ  fin
743 744 label_start_to_start: dΓ©but Γ  dΓ©but
744 745 label_start_to_end: dΓ©but Γ  fin
745 746 label_stay_logged_in: Rester connectΓ©
746 747 label_disabled: dΓ©sactivΓ©
747 748 label_show_completed_versions: Voir les versions passΓ©es
748 749 label_me: moi
749 750 label_board: Forum
750 751 label_board_new: Nouveau forum
751 752 label_board_plural: Forums
752 753 label_topic_plural: Discussions
753 754 label_message_plural: Messages
754 755 label_message_last: Dernier message
755 756 label_message_new: Nouveau message
756 757 label_message_posted: Message ajoutΓ©
757 758 label_reply_plural: RΓ©ponses
758 759 label_send_information: Envoyer les informations Γ  l'utilisateur
759 760 label_year: AnnΓ©e
760 761 label_month: Mois
761 762 label_week: Semaine
762 763 label_date_from: Du
763 764 label_date_to: Au
764 765 label_language_based: BasΓ© sur la langue de l'utilisateur
765 766 label_sort_by: "Trier par %{value}"
766 767 label_send_test_email: Envoyer un email de test
767 768 label_feeds_access_key_created_on: "Clé d'accès RSS créée il y a %{value}"
768 769 label_module_plural: Modules
769 770 label_added_time_by: "AjoutΓ© par %{author} il y a %{age}"
770 771 label_updated_time_by: "Mis Γ  jour par %{author} il y a %{age}"
771 772 label_updated_time: "Mis Γ  jour il y a %{value}"
772 773 label_jump_to_a_project: Aller Γ  un projet...
773 774 label_file_plural: Fichiers
774 775 label_changeset_plural: RΓ©visions
775 776 label_default_columns: Colonnes par dΓ©faut
776 777 label_no_change_option: (Pas de changement)
777 778 label_bulk_edit_selected_issues: Modifier les demandes sΓ©lectionnΓ©es
778 779 label_theme: Thème
779 780 label_default: DΓ©faut
780 781 label_search_titles_only: Uniquement dans les titres
781 782 label_user_mail_option_all: "Pour tous les Γ©vΓ©nements de tous mes projets"
782 783 label_user_mail_option_selected: "Pour tous les Γ©vΓ©nements des projets sΓ©lectionnΓ©s..."
783 784 label_user_mail_no_self_notified: "Je ne veux pas Γͺtre notifiΓ© des changements que j'effectue"
784 785 label_registration_activation_by_email: activation du compte par email
785 786 label_registration_manual_activation: activation manuelle du compte
786 787 label_registration_automatic_activation: activation automatique du compte
787 788 label_display_per_page: "Par page : %{value}"
788 789 label_age: Γ‚ge
789 790 label_change_properties: Changer les propriΓ©tΓ©s
790 791 label_general: GΓ©nΓ©ral
791 792 label_more: Plus
792 793 label_scm: SCM
793 794 label_plugins: Plugins
794 795 label_ldap_authentication: Authentification LDAP
795 796 label_downloads_abbr: D/L
796 797 label_optional_description: Description facultative
797 798 label_add_another_file: Ajouter un autre fichier
798 799 label_preferences: PrΓ©fΓ©rences
799 800 label_chronological_order: Dans l'ordre chronologique
800 801 label_reverse_chronological_order: Dans l'ordre chronologique inverse
801 802 label_planning: Planning
802 803 label_incoming_emails: Emails entrants
803 804 label_generate_key: GΓ©nΓ©rer une clΓ©
804 805 label_issue_watchers: Observateurs
805 806 label_example: Exemple
806 807 label_display: Affichage
807 808 label_sort: Tri
808 809 label_ascending: Croissant
809 810 label_descending: DΓ©croissant
810 811 label_date_from_to: Du %{start} au %{end}
811 812 label_wiki_content_added: Page wiki ajoutΓ©e
812 813 label_wiki_content_updated: Page wiki mise Γ  jour
813 814 label_group_plural: Groupes
814 815 label_group: Groupe
815 816 label_group_new: Nouveau groupe
816 817 label_time_entry_plural: Temps passΓ©
817 818 label_version_sharing_none: Non partagΓ©
818 819 label_version_sharing_descendants: Avec les sous-projets
819 820 label_version_sharing_hierarchy: Avec toute la hiΓ©rarchie
820 821 label_version_sharing_tree: Avec tout l'arbre
821 822 label_version_sharing_system: Avec tous les projets
822 823 label_copy_source: Source
823 824 label_copy_target: Cible
824 825 label_copy_same_as_target: Comme la cible
825 826 label_update_issue_done_ratios: Mettre Γ  jour l'avancement des demandes
826 827 label_display_used_statuses_only: N'afficher que les statuts utilisΓ©s dans ce tracker
827 828 label_api_access_key: Clé d'accès API
828 829 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
829 830 label_feeds_access_key: Clé d'accès RSS
830 831 label_missing_api_access_key: Clé d'accès API manquante
831 832 label_missing_feeds_access_key: Clé d'accès RSS manquante
832 833 label_close_versions: Fermer les versions terminΓ©es
833 834 label_revision_id: RΓ©vision %{value}
834 835 label_profile: Profil
835 836 label_subtask_plural: Sous-tΓ’ches
836 837 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
837 838 label_principal_search: "Rechercher un utilisateur ou un groupe :"
838 839 label_user_search: "Rechercher un utilisateur :"
839 840 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
840 841 label_additional_workflow_transitions_for_assignee: Autorisations supplΓ©mentaires lorsque la demande est assignΓ©e Γ  l'utilisateur
841 842 label_issues_visibility_all: Toutes les demandes
842 843 label_issues_visibility_public: Toutes les demandes non privΓ©es
843 844 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
844 845 label_export_options: Options d'exportation %{export_format}
845 846 label_copy_attachments: Copier les fichiers
846 847 label_copy_subtasks: Copier les sous-tΓ’ches
847 848 label_item_position: "%{position} sur %{count}"
848 849 label_completed_versions: Versions passΓ©es
849 850 label_session_expiration: Expiration des sessions
850 851 label_show_closed_projects: Voir les projets fermΓ©s
851 852 label_status_transitions: Changements de statut
852 853 label_fields_permissions: Permissions sur les champs
853 854 label_readonly: Lecture
854 855 label_required: Obligatoire
855 856 label_attribute_of_project: "%{name} du projet"
856 857 label_attribute_of_author: "%{name} de l'auteur"
857 858 label_attribute_of_assigned_to: "%{name} de l'assignΓ©"
858 859 label_attribute_of_fixed_version: "%{name} de la version cible"
859 860
860 861 button_login: Connexion
861 862 button_submit: Soumettre
862 863 button_save: Sauvegarder
863 864 button_check_all: Tout cocher
864 865 button_uncheck_all: Tout dΓ©cocher
865 866 button_collapse_all: Plier tout
866 867 button_expand_all: DΓ©plier tout
867 868 button_delete: Supprimer
868 869 button_create: CrΓ©er
869 870 button_create_and_continue: CrΓ©er et continuer
870 871 button_test: Tester
871 872 button_edit: Modifier
872 873 button_add: Ajouter
873 874 button_change: Changer
874 875 button_apply: Appliquer
875 876 button_clear: Effacer
876 877 button_lock: Verrouiller
877 878 button_unlock: DΓ©verrouiller
878 879 button_download: TΓ©lΓ©charger
879 880 button_list: Lister
880 881 button_view: Voir
881 882 button_move: DΓ©placer
882 883 button_move_and_follow: DΓ©placer et suivre
883 884 button_back: Retour
884 885 button_cancel: Annuler
885 886 button_activate: Activer
886 887 button_sort: Trier
887 888 button_log_time: Saisir temps
888 889 button_rollback: Revenir Γ  cette version
889 890 button_watch: Surveiller
890 891 button_unwatch: Ne plus surveiller
891 892 button_reply: RΓ©pondre
892 893 button_archive: Archiver
893 894 button_unarchive: DΓ©sarchiver
894 895 button_reset: RΓ©initialiser
895 896 button_rename: Renommer
896 897 button_change_password: Changer de mot de passe
897 898 button_copy: Copier
898 899 button_copy_and_follow: Copier et suivre
899 900 button_annotate: Annoter
900 901 button_update: Mettre Γ  jour
901 902 button_configure: Configurer
902 903 button_quote: Citer
903 904 button_duplicate: Dupliquer
904 905 button_show: Afficher
905 906 button_edit_section: Modifier cette section
906 907 button_export: Exporter
907 908 button_delete_my_account: Supprimer mon compte
908 909 button_close: Fermer
909 910 button_reopen: RΓ©ouvrir
910 911
911 912 status_active: actif
912 913 status_registered: enregistrΓ©
913 914 status_locked: verrouillΓ©
914 915
915 916 project_status_active: actif
916 917 project_status_closed: fermΓ©
917 918 project_status_archived: archivΓ©
918 919
919 920 version_status_open: ouvert
920 921 version_status_locked: verrouillΓ©
921 922 version_status_closed: fermΓ©
922 923
923 924 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e
924 925 text_regexp_info: ex. ^[A-Z0-9]+$
925 926 text_min_max_length_info: 0 pour aucune restriction
926 927 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
927 928 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront Γ©galement supprimΓ©s."
928 929 text_workflow_edit: SΓ©lectionner un tracker et un rΓ΄le pour Γ©diter le workflow
929 930 text_are_you_sure: Êtes-vous sûr ?
930 931 text_tip_issue_begin_day: tΓ’che commenΓ§ant ce jour
931 932 text_tip_issue_end_day: tΓ’che finissant ce jour
932 933 text_tip_issue_begin_end_day: tΓ’che commenΓ§ant et finissant ce jour
933 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 935 text_caracters_maximum: "%{count} caractères maximum."
935 936 text_caracters_minimum: "%{count} caractères minimum."
936 937 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
937 938 text_tracker_no_workflow: Aucun worflow n'est dΓ©fini pour ce tracker
938 939 text_unallowed_characters: Caractères non autorisés
939 940 text_comma_separated: Plusieurs valeurs possibles (sΓ©parΓ©es par des virgules).
940 941 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
941 942 text_issues_ref_in_commit_messages: RΓ©fΓ©rencement et rΓ©solution des demandes dans les commentaires de commits
942 943 text_issue_added: "La demande %{id} a Γ©tΓ© soumise par %{author}."
943 944 text_issue_updated: "La demande %{id} a Γ©tΓ© mise Γ  jour par %{author}."
944 945 text_wiki_destroy_confirmation: Etes-vous sΓ»r de vouloir supprimer ce wiki et tout son contenu ?
945 946 text_issue_category_destroy_question: "%{count} demandes sont affectΓ©es Γ  cette catΓ©gorie. Que voulez-vous faire ?"
946 947 text_issue_category_destroy_assignments: N'affecter les demandes Γ  aucune autre catΓ©gorie
947 948 text_issue_category_reassign_to: RΓ©affecter les demandes Γ  cette catΓ©gorie
948 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 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 951 text_load_default_configuration: Charger le paramΓ©trage par dΓ©faut
951 952 text_status_changed_by_changeset: "AppliquΓ© par commit %{value}."
952 953 text_time_logged_by_changeset: "AppliquΓ© par commit %{value}"
953 954 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
954 955 text_issues_destroy_descendants_confirmation: "Cela entrainera Γ©galement la suppression de %{count} sous-tΓ’che(s)."
955 956 text_select_project_modules: 'SΓ©lectionner les modules Γ  activer pour ce projet :'
956 957 text_default_administrator_account_changed: Compte administrateur par dΓ©faut changΓ©
957 958 text_file_repository_writable: RΓ©pertoire de stockage des fichiers accessible en Γ©criture
958 959 text_plugin_assets_writable: RΓ©pertoire public des plugins accessible en Γ©criture
959 960 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
960 961 text_destroy_time_entries_question: "%{hours} heures ont Γ©tΓ© enregistrΓ©es sur les demandes Γ  supprimer. Que voulez-vous faire ?"
961 962 text_destroy_time_entries: Supprimer les heures
962 963 text_assign_time_entries_to_project: Reporter les heures sur le projet
963 964 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
964 965 text_user_wrote: "%{value} a Γ©crit :"
965 966 text_enumeration_destroy_question: "Cette valeur est affectΓ©e Γ  %{count} objets."
966 967 text_enumeration_category_reassign_to: 'RΓ©affecter les objets Γ  cette valeur:'
967 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 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 970 text_diff_truncated: '... Ce diffΓ©rentiel a Γ©tΓ© tronquΓ© car il excΓ¨de la taille maximale pouvant Γͺtre affichΓ©e.'
970 971 text_custom_field_possible_values_info: 'Une ligne par valeur'
971 972 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
972 973 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
973 974 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
974 975 text_wiki_page_reassign_children: "RΓ©affecter les sous-pages Γ  cette page"
975 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 977 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardΓ© qui sera perdu si vous quittez la page."
977 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 979 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
979 980 text_issue_conflict_resolution_cancel: "Annuler ma mise Γ  jour et rΓ©afficher %{link}"
980 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 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 983 text_project_closed: Ce projet est fermΓ© et accessible en lecture seule.
983 984
984 985 default_role_manager: "Manager "
985 986 default_role_developer: "DΓ©veloppeur "
986 987 default_role_reporter: "Rapporteur "
987 988 default_tracker_bug: Anomalie
988 989 default_tracker_feature: Evolution
989 990 default_tracker_support: Assistance
990 991 default_issue_status_new: Nouveau
991 992 default_issue_status_in_progress: En cours
992 993 default_issue_status_resolved: RΓ©solu
993 994 default_issue_status_feedback: Commentaire
994 995 default_issue_status_closed: FermΓ©
995 996 default_issue_status_rejected: RejetΓ©
996 997 default_doc_category_user: Documentation utilisateur
997 998 default_doc_category_tech: Documentation technique
998 999 default_priority_low: Bas
999 1000 default_priority_normal: Normal
1000 1001 default_priority_high: Haut
1001 1002 default_priority_urgent: Urgent
1002 1003 default_priority_immediate: ImmΓ©diat
1003 1004 default_activity_design: Conception
1004 1005 default_activity_development: DΓ©veloppement
1005 1006
1006 1007 enumeration_issue_priorities: PrioritΓ©s des demandes
1007 1008 enumeration_doc_categories: CatΓ©gories des documents
1008 1009 enumeration_activities: ActivitΓ©s (suivi du temps)
1009 1010 label_greater_or_equal: ">="
1010 1011 label_less_or_equal: "<="
1011 1012 label_between: entre
1012 1013 label_view_all_revisions: Voir toutes les rΓ©visions
1013 1014 label_tag: Tag
1014 1015 label_branch: Branche
1015 1016 error_no_tracker_in_project: "Aucun tracker n'est associΓ© Γ  ce projet. VΓ©rifier la configuration du projet."
1016 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 1018 text_journal_changed: "%{label} changΓ© de %{old} Γ  %{new}"
1018 1019 text_journal_changed_no_detail: "%{label} mis Γ  jour"
1019 1020 text_journal_set_to: "%{label} mis Γ  %{value}"
1020 1021 text_journal_deleted: "%{label} %{old} supprimΓ©"
1021 1022 text_journal_added: "%{label} %{value} ajoutΓ©"
1022 1023 enumeration_system_activity: Activité système
1023 1024 label_board_sticky: Sticky
1024 1025 label_board_locked: VerrouillΓ©
1025 1026 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
1026 1027 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisΓ©
1027 1028 error_unable_to_connect: Connexion impossible (%{value})
1028 1029 error_can_not_remove_role: Ce rΓ΄le est utilisΓ© et ne peut pas Γͺtre supprimΓ©.
1029 1030 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas Γͺtre supprimΓ©.
1030 1031 field_principal: Principal
1031 1032 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
1032 1033 text_zoom_out: Zoom arrière
1033 1034 text_zoom_in: Zoom avant
1034 1035 notice_unable_delete_time_entry: Impossible de supprimer le temps passΓ©.
1035 1036 label_overall_spent_time: Temps passΓ© global
1036 1037 field_time_entries: Temps passΓ©
1037 1038 project_module_gantt: Gantt
1038 1039 project_module_calendar: Calendrier
1039 1040 button_edit_associated_wikipage: "Modifier la page wiki associΓ©e: %{page_title}"
1040 1041 text_are_you_sure_with_children: Supprimer la demande et toutes ses sous-demandes ?
1041 1042 field_text: Champ texte
1042 1043 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
1043 1044 setting_default_notification_option: Option de notification par dΓ©faut
1044 1045 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
1045 1046 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assignΓ©
1046 1047 label_user_mail_option_none: Aucune notification
1047 1048 field_member_of_group: Groupe de l'assignΓ©
1048 1049 field_assigned_to_role: RΓ΄le de l'assignΓ©
1049 1050 setting_emails_header: En-tΓͺte des emails
1050 1051 label_bulk_edit_selected_time_entries: Modifier les temps passΓ©s sΓ©lectionnΓ©s
1051 1052 text_time_entries_destroy_confirmation: "Etes-vous sΓ»r de vouloir supprimer les temps passΓ©s sΓ©lectionnΓ©s ?"
1052 1053 field_scm_path_encoding: Encodage des chemins
1053 1054 text_scm_path_encoding_note: "DΓ©faut : UTF-8"
1054 1055 field_path_to_repository: Chemin du dΓ©pΓ΄t
1055 1056 field_root_directory: RΓ©pertoire racine
1056 1057 field_cvs_module: Module
1057 1058 field_cvsroot: CVSROOT
1058 1059 text_mercurial_repository_note: "DΓ©pΓ΄t local (exemples : /hgrepo, c:\\hgrepo)"
1059 1060 text_scm_command: Commande
1060 1061 text_scm_command_version: Version
1061 1062 label_git_report_last_commit: Afficher le dernier commit des fichiers et rΓ©pertoires
1062 1063 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1063 1064 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1064 1065 label_diff: diff
1065 1066 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1066 1067 description_query_sort_criteria_direction: Ordre de tri
1067 1068 description_project_scope: Périmètre de recherche
1068 1069 description_filter: Filtre
1069 1070 description_user_mail_notification: Option de notification
1070 1071 description_date_from: Date de dΓ©but
1071 1072 description_message_content: Contenu du message
1072 1073 description_available_columns: Colonnes disponibles
1073 1074 description_all_columns: Toutes les colonnes
1074 1075 description_date_range_interval: Choisir une pΓ©riode
1075 1076 description_issue_category_reassign: Choisir une catΓ©gorie
1076 1077 description_search: Champ de recherche
1077 1078 description_notes: Notes
1078 1079 description_date_range_list: Choisir une pΓ©riode prΓ©dΓ©finie
1079 1080 description_choose_project: Projets
1080 1081 description_date_to: Date de fin
1081 1082 description_query_sort_criteria_attribute: Critère de tri
1082 1083 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1083 1084 description_selected_columns: Colonnes sΓ©lectionnΓ©es
1084 1085 label_parent_revision: Parent
1085 1086 label_child_revision: Enfant
1086 1087 error_scm_annotate_big_text_file: Cette entrΓ©e ne peut pas Γͺtre annotΓ©e car elle excΓ¨de la taille maximale.
1087 1088 setting_repositories_encodings: Encodages des fichiers et des dΓ©pΓ΄ts
1088 1089 label_search_for_watchers: Rechercher des observateurs
1089 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 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18
19 19 # DO NOT MODIFY THIS FILE !!!
20 20 # Settings can be defined through the application in Admin -> Settings
21 21
22 22 app_title:
23 23 default: Redmine
24 24 app_subtitle:
25 25 default: Project management
26 26 welcome_text:
27 27 default:
28 28 login_required:
29 29 default: 0
30 30 self_registration:
31 31 default: '2'
32 32 lost_password:
33 33 default: 1
34 34 unsubscribe:
35 35 default: 1
36 36 password_min_length:
37 37 format: int
38 38 default: 4
39 39 # Maximum lifetime of user sessions in minutes
40 40 session_lifetime:
41 41 format: int
42 42 default: 0
43 43 # User session timeout in minutes
44 44 session_timeout:
45 45 format: int
46 46 default: 0
47 47 attachment_max_size:
48 48 format: int
49 49 default: 5120
50 50 issues_export_limit:
51 51 format: int
52 52 default: 500
53 53 activity_days_default:
54 54 format: int
55 55 default: 30
56 56 per_page_options:
57 57 default: '25,50,100'
58 58 mail_from:
59 59 default: redmine@example.net
60 60 bcc_recipients:
61 61 default: 1
62 62 plain_text_mail:
63 63 default: 0
64 64 text_formatting:
65 65 default: textile
66 66 cache_formatted_text:
67 67 default: 0
68 68 wiki_compression:
69 69 default: ""
70 70 default_language:
71 71 default: en
72 72 host_name:
73 73 default: localhost:3000
74 74 protocol:
75 75 default: http
76 76 feeds_limit:
77 77 format: int
78 78 default: 15
79 79 gantt_items_limit:
80 80 format: int
81 81 default: 500
82 82 # Maximum size of files that can be displayed
83 83 # inline through the file viewer (in KB)
84 84 file_max_size_displayed:
85 85 format: int
86 86 default: 512
87 87 diff_max_lines_displayed:
88 88 format: int
89 89 default: 1500
90 90 enabled_scm:
91 91 serialized: true
92 92 default:
93 93 - Subversion
94 94 - Darcs
95 95 - Mercurial
96 96 - Cvs
97 97 - Bazaar
98 98 - Git
99 99 autofetch_changesets:
100 100 default: 1
101 101 sys_api_enabled:
102 102 default: 0
103 103 sys_api_key:
104 104 default: ''
105 105 commit_cross_project_ref:
106 106 default: 0
107 107 commit_ref_keywords:
108 108 default: 'refs,references,IssueID'
109 109 commit_fix_keywords:
110 110 default: 'fixes,closes'
111 111 commit_fix_status_id:
112 112 format: int
113 113 default: 0
114 114 commit_fix_done_ratio:
115 115 default: 100
116 116 commit_logtime_enabled:
117 117 default: 0
118 118 commit_logtime_activity_id:
119 119 format: int
120 120 default: 0
121 121 # autologin duration in days
122 122 # 0 means autologin is disabled
123 123 autologin:
124 124 format: int
125 125 default: 0
126 126 # date format
127 127 date_format:
128 128 default: ''
129 129 time_format:
130 130 default: ''
131 131 user_format:
132 132 default: :firstname_lastname
133 133 format: symbol
134 134 cross_project_issue_relations:
135 135 default: 0
136 # Enables subtasks to be in other projects
137 cross_project_subtasks:
138 default: 'tree'
136 139 issue_group_assignment:
137 140 default: 0
138 141 default_issue_start_date_to_creation_date:
139 142 default: 1
140 143 notified_events:
141 144 serialized: true
142 145 default:
143 146 - issue_added
144 147 - issue_updated
145 148 mail_handler_body_delimiters:
146 149 default: ''
147 150 mail_handler_api_enabled:
148 151 default: 0
149 152 mail_handler_api_key:
150 153 default:
151 154 issue_list_default_columns:
152 155 serialized: true
153 156 default:
154 157 - tracker
155 158 - status
156 159 - priority
157 160 - subject
158 161 - assigned_to
159 162 - updated_on
160 163 display_subprojects_issues:
161 164 default: 1
162 165 issue_done_ratio:
163 166 default: 'issue_field'
164 167 default_projects_public:
165 168 default: 1
166 169 default_projects_modules:
167 170 serialized: true
168 171 default:
169 172 - issue_tracking
170 173 - time_tracking
171 174 - news
172 175 - documents
173 176 - files
174 177 - wiki
175 178 - repository
176 179 - boards
177 180 - calendar
178 181 - gantt
179 182 # Role given to a non-admin user who creates a project
180 183 new_project_user_role_id:
181 184 format: int
182 185 default: ''
183 186 sequential_project_identifiers:
184 187 default: 0
185 188 # encodings used to convert repository files content to UTF-8
186 189 # multiple values accepted, comma separated
187 190 repositories_encodings:
188 191 default: ''
189 192 # encoding used to convert commit logs to UTF-8
190 193 commit_logs_encoding:
191 194 default: 'UTF-8'
192 195 repository_log_display_limit:
193 196 format: int
194 197 default: 100
195 198 ui_theme:
196 199 default: ''
197 200 emails_footer:
198 201 default: |-
199 202 You have received this notification because you have either subscribed to it, or are involved in it.
200 203 To change your notification preferences, please click here: http://hostname/my/account
201 204 gravatar_enabled:
202 205 default: 0
203 206 openid:
204 207 default: 0
205 208 gravatar_default:
206 209 default: ''
207 210 start_of_week:
208 211 default: ''
209 212 rest_api_enabled:
210 213 default: 0
211 214 default_notification_option:
212 215 default: 'only_my_events'
213 216 emails_header:
214 217 default: ''
215 218 thumbnails_enabled:
216 219 default: 0
217 220 thumbnails_size:
218 221 format: int
219 222 default: 100
@@ -1,44 +1,47
1 1 ---
2 2 projects_trackers_001:
3 3 project_id: 4
4 4 tracker_id: 3
5 5 projects_trackers_002:
6 6 project_id: 1
7 7 tracker_id: 1
8 8 projects_trackers_003:
9 9 project_id: 5
10 10 tracker_id: 1
11 11 projects_trackers_004:
12 12 project_id: 1
13 13 tracker_id: 2
14 14 projects_trackers_005:
15 15 project_id: 5
16 16 tracker_id: 2
17 17 projects_trackers_006:
18 18 project_id: 5
19 19 tracker_id: 3
20 20 projects_trackers_007:
21 21 project_id: 2
22 22 tracker_id: 1
23 23 projects_trackers_008:
24 24 project_id: 2
25 25 tracker_id: 2
26 26 projects_trackers_009:
27 27 project_id: 2
28 28 tracker_id: 3
29 29 projects_trackers_010:
30 30 project_id: 3
31 31 tracker_id: 2
32 32 projects_trackers_011:
33 33 project_id: 3
34 34 tracker_id: 3
35 35 projects_trackers_012:
36 36 project_id: 4
37 37 tracker_id: 1
38 38 projects_trackers_013:
39 39 project_id: 4
40 40 tracker_id: 2
41 41 projects_trackers_014:
42 42 project_id: 1
43 43 tracker_id: 3
44 projects_trackers_015:
45 project_id: 6
46 tracker_id: 1
44 47 No newline at end of file
@@ -1,472 +1,480
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 #require 'shoulda'
19 19 ENV["RAILS_ENV"] = "test"
20 20 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
21 21 require 'rails/test_help'
22 22 require Rails.root.join('test', 'mocks', 'open_id_authentication_mock.rb').to_s
23 23
24 24 require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
25 25 include ObjectHelpers
26 26
27 27 class ActiveSupport::TestCase
28 28 include ActionDispatch::TestProcess
29 29
30 30 # Transactional fixtures accelerate your tests by wrapping each test method
31 31 # in a transaction that's rolled back on completion. This ensures that the
32 32 # test database remains unchanged so your fixtures don't have to be reloaded
33 33 # between every test method. Fewer database queries means faster tests.
34 34 #
35 35 # Read Mike Clark's excellent walkthrough at
36 36 # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
37 37 #
38 38 # Every Active Record database supports transactions except MyISAM tables
39 39 # in MySQL. Turn off transactional fixtures in this case; however, if you
40 40 # don't care one way or the other, switching from MyISAM to InnoDB tables
41 41 # is recommended.
42 42 self.use_transactional_fixtures = true
43 43
44 44 # Instantiated fixtures are slow, but give you @david where otherwise you
45 45 # would need people(:david). If you don't want to migrate your existing
46 46 # test cases which use the @david style and don't mind the speed hit (each
47 47 # instantiated fixtures translates to a database query per test method),
48 48 # then set this back to true.
49 49 self.use_instantiated_fixtures = false
50 50
51 51 # Add more helper methods to be used by all tests here...
52 52
53 53 def log_user(login, password)
54 54 User.anonymous
55 55 get "/login"
56 56 assert_equal nil, session[:user_id]
57 57 assert_response :success
58 58 assert_template "account/login"
59 59 post "/login", :username => login, :password => password
60 60 assert_equal login, User.find(session[:user_id]).login
61 61 end
62 62
63 63 def uploaded_test_file(name, mime)
64 64 fixture_file_upload("files/#{name}", mime, true)
65 65 end
66 66
67 67 def credentials(user, password=nil)
68 68 {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
69 69 end
70 70
71 71 # Mock out a file
72 72 def self.mock_file
73 73 file = 'a_file.png'
74 74 file.stubs(:size).returns(32)
75 75 file.stubs(:original_filename).returns('a_file.png')
76 76 file.stubs(:content_type).returns('image/png')
77 77 file.stubs(:read).returns(false)
78 78 file
79 79 end
80 80
81 81 def mock_file
82 82 self.class.mock_file
83 83 end
84 84
85 85 def mock_file_with_options(options={})
86 86 file = ''
87 87 file.stubs(:size).returns(32)
88 88 original_filename = options[:original_filename] || nil
89 89 file.stubs(:original_filename).returns(original_filename)
90 90 content_type = options[:content_type] || nil
91 91 file.stubs(:content_type).returns(content_type)
92 92 file.stubs(:read).returns(false)
93 93 file
94 94 end
95 95
96 96 # Use a temporary directory for attachment related tests
97 97 def set_tmp_attachments_directory
98 98 Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test")
99 99 unless File.directory?("#{Rails.root}/tmp/test/attachments")
100 100 Dir.mkdir "#{Rails.root}/tmp/test/attachments"
101 101 end
102 102 Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
103 103 end
104 104
105 105 def set_fixtures_attachments_directory
106 106 Attachment.storage_path = "#{Rails.root}/test/fixtures/files"
107 107 end
108 108
109 109 def with_settings(options, &block)
110 110 saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].is_a?(Symbol) ? Setting[k] : Setting[k].dup; h}
111 111 options.each {|k, v| Setting[k] = v}
112 112 yield
113 113 ensure
114 114 saved_settings.each {|k, v| Setting[k] = v} if saved_settings
115 115 end
116 116
117 117 def change_user_password(login, new_password)
118 118 user = User.first(:conditions => {:login => login})
119 119 user.password, user.password_confirmation = new_password, new_password
120 120 user.save!
121 121 end
122 122
123 123 def self.ldap_configured?
124 124 @test_ldap = Net::LDAP.new(:host => '127.0.0.1', :port => 389)
125 125 return @test_ldap.bind
126 126 rescue Exception => e
127 127 # LDAP is not listening
128 128 return nil
129 129 end
130 130
131 131 def self.convert_installed?
132 132 Redmine::Thumbnail.convert_available?
133 133 end
134 134
135 135 # Returns the path to the test +vendor+ repository
136 136 def self.repository_path(vendor)
137 137 Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
138 138 end
139 139
140 140 # Returns the url of the subversion test repository
141 141 def self.subversion_repository_url
142 142 path = repository_path('subversion')
143 143 path = '/' + path unless path.starts_with?('/')
144 144 "file://#{path}"
145 145 end
146 146
147 147 # Returns true if the +vendor+ test repository is configured
148 148 def self.repository_configured?(vendor)
149 149 File.directory?(repository_path(vendor))
150 150 end
151 151
152 152 def repository_path_hash(arr)
153 153 hs = {}
154 154 hs[:path] = arr.join("/")
155 155 hs[:param] = arr.join("/")
156 156 hs
157 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 167 def assert_error_tag(options={})
160 168 assert_tag({:attributes => { :id => 'errorExplanation' }}.merge(options))
161 169 end
162 170
163 171 def assert_include(expected, s, message=nil)
164 172 assert s.include?(expected), (message || "\"#{expected}\" not found in \"#{s}\"")
165 173 end
166 174
167 175 def assert_not_include(expected, s)
168 176 assert !s.include?(expected), "\"#{expected}\" found in \"#{s}\""
169 177 end
170 178
171 179 def assert_mail_body_match(expected, mail)
172 180 if expected.is_a?(String)
173 181 assert_include expected, mail_body(mail)
174 182 else
175 183 assert_match expected, mail_body(mail)
176 184 end
177 185 end
178 186
179 187 def assert_mail_body_no_match(expected, mail)
180 188 if expected.is_a?(String)
181 189 assert_not_include expected, mail_body(mail)
182 190 else
183 191 assert_no_match expected, mail_body(mail)
184 192 end
185 193 end
186 194
187 195 def mail_body(mail)
188 196 mail.parts.first.body.encoded
189 197 end
190 198
191 199 # Shoulda macros
192 200 def self.should_render_404
193 201 should_respond_with :not_found
194 202 should_render_template 'common/error'
195 203 end
196 204
197 205 def self.should_have_before_filter(expected_method, options = {})
198 206 should_have_filter('before', expected_method, options)
199 207 end
200 208
201 209 def self.should_have_after_filter(expected_method, options = {})
202 210 should_have_filter('after', expected_method, options)
203 211 end
204 212
205 213 def self.should_have_filter(filter_type, expected_method, options)
206 214 description = "have #{filter_type}_filter :#{expected_method}"
207 215 description << " with #{options.inspect}" unless options.empty?
208 216
209 217 should description do
210 218 klass = "action_controller/filters/#{filter_type}_filter".classify.constantize
211 219 expected = klass.new(:filter, expected_method.to_sym, options)
212 220 assert_equal 1, @controller.class.filter_chain.select { |filter|
213 221 filter.method == expected.method && filter.kind == expected.kind &&
214 222 filter.options == expected.options && filter.class == expected.class
215 223 }.size
216 224 end
217 225 end
218 226
219 227 # Test that a request allows the three types of API authentication
220 228 #
221 229 # * HTTP Basic with username and password
222 230 # * HTTP Basic with an api key for the username
223 231 # * Key based with the key=X parameter
224 232 #
225 233 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
226 234 # @param [String] url the request url
227 235 # @param [optional, Hash] parameters additional request parameters
228 236 # @param [optional, Hash] options additional options
229 237 # @option options [Symbol] :success_code Successful response code (:success)
230 238 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
231 239 def self.should_allow_api_authentication(http_method, url, parameters={}, options={})
232 240 should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options)
233 241 should_allow_http_basic_auth_with_key(http_method, url, parameters, options)
234 242 should_allow_key_based_auth(http_method, url, parameters, options)
235 243 end
236 244
237 245 # Test that a request allows the username and password for HTTP BASIC
238 246 #
239 247 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
240 248 # @param [String] url the request url
241 249 # @param [optional, Hash] parameters additional request parameters
242 250 # @param [optional, Hash] options additional options
243 251 # @option options [Symbol] :success_code Successful response code (:success)
244 252 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
245 253 def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={})
246 254 success_code = options[:success_code] || :success
247 255 failure_code = options[:failure_code] || :unauthorized
248 256
249 257 context "should allow http basic auth using a username and password for #{http_method} #{url}" do
250 258 context "with a valid HTTP authentication" do
251 259 setup do
252 260 @user = User.generate! do |user|
253 261 user.admin = true
254 262 user.password = 'my_password'
255 263 end
256 264 send(http_method, url, parameters, credentials(@user.login, 'my_password'))
257 265 end
258 266
259 267 should_respond_with success_code
260 268 should_respond_with_content_type_based_on_url(url)
261 269 should "login as the user" do
262 270 assert_equal @user, User.current
263 271 end
264 272 end
265 273
266 274 context "with an invalid HTTP authentication" do
267 275 setup do
268 276 @user = User.generate!
269 277 send(http_method, url, parameters, credentials(@user.login, 'wrong_password'))
270 278 end
271 279
272 280 should_respond_with failure_code
273 281 should_respond_with_content_type_based_on_url(url)
274 282 should "not login as the user" do
275 283 assert_equal User.anonymous, User.current
276 284 end
277 285 end
278 286
279 287 context "without credentials" do
280 288 setup do
281 289 send(http_method, url, parameters)
282 290 end
283 291
284 292 should_respond_with failure_code
285 293 should_respond_with_content_type_based_on_url(url)
286 294 should "include_www_authenticate_header" do
287 295 assert @controller.response.headers.has_key?('WWW-Authenticate')
288 296 end
289 297 end
290 298 end
291 299 end
292 300
293 301 # Test that a request allows the API key with HTTP BASIC
294 302 #
295 303 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
296 304 # @param [String] url the request url
297 305 # @param [optional, Hash] parameters additional request parameters
298 306 # @param [optional, Hash] options additional options
299 307 # @option options [Symbol] :success_code Successful response code (:success)
300 308 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
301 309 def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={})
302 310 success_code = options[:success_code] || :success
303 311 failure_code = options[:failure_code] || :unauthorized
304 312
305 313 context "should allow http basic auth with a key for #{http_method} #{url}" do
306 314 context "with a valid HTTP authentication using the API token" do
307 315 setup do
308 316 @user = User.generate! do |user|
309 317 user.admin = true
310 318 end
311 319 @token = Token.create!(:user => @user, :action => 'api')
312 320 send(http_method, url, parameters, credentials(@token.value, 'X'))
313 321 end
314 322 should_respond_with success_code
315 323 should_respond_with_content_type_based_on_url(url)
316 324 should_be_a_valid_response_string_based_on_url(url)
317 325 should "login as the user" do
318 326 assert_equal @user, User.current
319 327 end
320 328 end
321 329
322 330 context "with an invalid HTTP authentication" do
323 331 setup do
324 332 @user = User.generate!
325 333 @token = Token.create!(:user => @user, :action => 'feeds')
326 334 send(http_method, url, parameters, credentials(@token.value, 'X'))
327 335 end
328 336 should_respond_with failure_code
329 337 should_respond_with_content_type_based_on_url(url)
330 338 should "not login as the user" do
331 339 assert_equal User.anonymous, User.current
332 340 end
333 341 end
334 342 end
335 343 end
336 344
337 345 # Test that a request allows full key authentication
338 346 #
339 347 # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
340 348 # @param [String] url the request url, without the key=ZXY parameter
341 349 # @param [optional, Hash] parameters additional request parameters
342 350 # @param [optional, Hash] options additional options
343 351 # @option options [Symbol] :success_code Successful response code (:success)
344 352 # @option options [Symbol] :failure_code Failure response code (:unauthorized)
345 353 def self.should_allow_key_based_auth(http_method, url, parameters={}, options={})
346 354 success_code = options[:success_code] || :success
347 355 failure_code = options[:failure_code] || :unauthorized
348 356
349 357 context "should allow key based auth using key=X for #{http_method} #{url}" do
350 358 context "with a valid api token" do
351 359 setup do
352 360 @user = User.generate! do |user|
353 361 user.admin = true
354 362 end
355 363 @token = Token.create!(:user => @user, :action => 'api')
356 364 # Simple url parse to add on ?key= or &key=
357 365 request_url = if url.match(/\?/)
358 366 url + "&key=#{@token.value}"
359 367 else
360 368 url + "?key=#{@token.value}"
361 369 end
362 370 send(http_method, request_url, parameters)
363 371 end
364 372 should_respond_with success_code
365 373 should_respond_with_content_type_based_on_url(url)
366 374 should_be_a_valid_response_string_based_on_url(url)
367 375 should "login as the user" do
368 376 assert_equal @user, User.current
369 377 end
370 378 end
371 379
372 380 context "with an invalid api token" do
373 381 setup do
374 382 @user = User.generate! do |user|
375 383 user.admin = true
376 384 end
377 385 @token = Token.create!(:user => @user, :action => 'feeds')
378 386 # Simple url parse to add on ?key= or &key=
379 387 request_url = if url.match(/\?/)
380 388 url + "&key=#{@token.value}"
381 389 else
382 390 url + "?key=#{@token.value}"
383 391 end
384 392 send(http_method, request_url, parameters)
385 393 end
386 394 should_respond_with failure_code
387 395 should_respond_with_content_type_based_on_url(url)
388 396 should "not login as the user" do
389 397 assert_equal User.anonymous, User.current
390 398 end
391 399 end
392 400 end
393 401
394 402 context "should allow key based auth using X-Redmine-API-Key header for #{http_method} #{url}" do
395 403 setup do
396 404 @user = User.generate! do |user|
397 405 user.admin = true
398 406 end
399 407 @token = Token.create!(:user => @user, :action => 'api')
400 408 send(http_method, url, parameters, {'X-Redmine-API-Key' => @token.value.to_s})
401 409 end
402 410 should_respond_with success_code
403 411 should_respond_with_content_type_based_on_url(url)
404 412 should_be_a_valid_response_string_based_on_url(url)
405 413 should "login as the user" do
406 414 assert_equal @user, User.current
407 415 end
408 416 end
409 417 end
410 418
411 419 # Uses should_respond_with_content_type based on what's in the url:
412 420 #
413 421 # '/project/issues.xml' => should_respond_with_content_type :xml
414 422 # '/project/issues.json' => should_respond_with_content_type :json
415 423 #
416 424 # @param [String] url Request
417 425 def self.should_respond_with_content_type_based_on_url(url)
418 426 case
419 427 when url.match(/xml/i)
420 428 should "respond with XML" do
421 429 assert_equal 'application/xml', @response.content_type
422 430 end
423 431 when url.match(/json/i)
424 432 should "respond with JSON" do
425 433 assert_equal 'application/json', @response.content_type
426 434 end
427 435 else
428 436 raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
429 437 end
430 438 end
431 439
432 440 # Uses the url to assert which format the response should be in
433 441 #
434 442 # '/project/issues.xml' => should_be_a_valid_xml_string
435 443 # '/project/issues.json' => should_be_a_valid_json_string
436 444 #
437 445 # @param [String] url Request
438 446 def self.should_be_a_valid_response_string_based_on_url(url)
439 447 case
440 448 when url.match(/xml/i)
441 449 should_be_a_valid_xml_string
442 450 when url.match(/json/i)
443 451 should_be_a_valid_json_string
444 452 else
445 453 raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
446 454 end
447 455 end
448 456
449 457 # Checks that the response is a valid JSON string
450 458 def self.should_be_a_valid_json_string
451 459 should "be a valid JSON string (or empty)" do
452 460 assert(response.body.blank? || ActiveSupport::JSON.decode(response.body))
453 461 end
454 462 end
455 463
456 464 # Checks that the response is a valid XML string
457 465 def self.should_be_a_valid_xml_string
458 466 should "be a valid XML string" do
459 467 assert REXML::Document.new(response.body)
460 468 end
461 469 end
462 470
463 471 def self.should_respond_with(status)
464 472 should "respond with #{status}" do
465 473 assert_response status
466 474 end
467 475 end
468 476 end
469 477
470 478 # Simple module to "namespace" all of the API tests
471 479 module ApiTest
472 480 end
@@ -1,399 +1,407
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class IssueNestedSetTest < ActiveSupport::TestCase
21 21 fixtures :projects, :users, :members, :member_roles, :roles,
22 22 :trackers, :projects_trackers,
23 23 :versions,
24 24 :issue_statuses, :issue_categories, :issue_relations, :workflows,
25 25 :enumerations,
26 26 :issues,
27 27 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
28 28 :time_entries
29 29
30 30 self.use_transactional_fixtures = false
31 31
32 32 def test_create_root_issue
33 33 issue1 = create_issue!
34 34 issue2 = create_issue!
35 35 issue1.reload
36 36 issue2.reload
37 37
38 38 assert_equal [issue1.id, nil, 1, 2], [issue1.root_id, issue1.parent_id, issue1.lft, issue1.rgt]
39 39 assert_equal [issue2.id, nil, 1, 2], [issue2.root_id, issue2.parent_id, issue2.lft, issue2.rgt]
40 40 end
41 41
42 42 def test_create_child_issue
43 43 parent = create_issue!
44 44 child = create_issue!(:parent_issue_id => parent.id)
45 45 parent.reload
46 46 child.reload
47 47
48 48 assert_equal [parent.id, nil, 1, 4], [parent.root_id, parent.parent_id, parent.lft, parent.rgt]
49 49 assert_equal [parent.id, parent.id, 2, 3], [child.root_id, child.parent_id, child.lft, child.rgt]
50 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 61 issue = create_issue!
54 62 child = Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
55 63 :subject => 'child', :parent_issue_id => issue.id)
56 64 assert !child.save
57 65 assert_not_nil child.errors[:parent_issue_id]
58 66 end
59 67
60 68 def test_move_a_root_to_child
61 69 parent1 = create_issue!
62 70 parent2 = create_issue!
63 71 child = create_issue!(:parent_issue_id => parent1.id)
64 72
65 73 parent2.parent_issue_id = parent1.id
66 74 parent2.save!
67 75 child.reload
68 76 parent1.reload
69 77 parent2.reload
70 78
71 79 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
72 80 assert_equal [parent1.id, 4, 5], [parent2.root_id, parent2.lft, parent2.rgt]
73 81 assert_equal [parent1.id, 2, 3], [child.root_id, child.lft, child.rgt]
74 82 end
75 83
76 84 def test_move_a_child_to_root
77 85 parent1 = create_issue!
78 86 parent2 = create_issue!
79 87 child = create_issue!(:parent_issue_id => parent1.id)
80 88
81 89 child.parent_issue_id = nil
82 90 child.save!
83 91 child.reload
84 92 parent1.reload
85 93 parent2.reload
86 94
87 95 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
88 96 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
89 97 assert_equal [child.id, 1, 2], [child.root_id, child.lft, child.rgt]
90 98 end
91 99
92 100 def test_move_a_child_to_another_issue
93 101 parent1 = create_issue!
94 102 parent2 = create_issue!
95 103 child = create_issue!(:parent_issue_id => parent1.id)
96 104
97 105 child.parent_issue_id = parent2.id
98 106 child.save!
99 107 child.reload
100 108 parent1.reload
101 109 parent2.reload
102 110
103 111 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
104 112 assert_equal [parent2.id, 1, 4], [parent2.root_id, parent2.lft, parent2.rgt]
105 113 assert_equal [parent2.id, 2, 3], [child.root_id, child.lft, child.rgt]
106 114 end
107 115
108 116 def test_move_a_child_with_descendants_to_another_issue
109 117 parent1 = create_issue!
110 118 parent2 = create_issue!
111 119 child = create_issue!(:parent_issue_id => parent1.id)
112 120 grandchild = create_issue!(:parent_issue_id => child.id)
113 121
114 122 parent1.reload
115 123 parent2.reload
116 124 child.reload
117 125 grandchild.reload
118 126
119 127 assert_equal [parent1.id, 1, 6], [parent1.root_id, parent1.lft, parent1.rgt]
120 128 assert_equal [parent2.id, 1, 2], [parent2.root_id, parent2.lft, parent2.rgt]
121 129 assert_equal [parent1.id, 2, 5], [child.root_id, child.lft, child.rgt]
122 130 assert_equal [parent1.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
123 131
124 132 child.reload.parent_issue_id = parent2.id
125 133 child.save!
126 134 child.reload
127 135 grandchild.reload
128 136 parent1.reload
129 137 parent2.reload
130 138
131 139 assert_equal [parent1.id, 1, 2], [parent1.root_id, parent1.lft, parent1.rgt]
132 140 assert_equal [parent2.id, 1, 6], [parent2.root_id, parent2.lft, parent2.rgt]
133 141 assert_equal [parent2.id, 2, 5], [child.root_id, child.lft, child.rgt]
134 142 assert_equal [parent2.id, 3, 4], [grandchild.root_id, grandchild.lft, grandchild.rgt]
135 143 end
136 144
137 145 def test_move_a_child_with_descendants_to_another_project
138 146 parent1 = create_issue!
139 147 child = create_issue!(:parent_issue_id => parent1.id)
140 148 grandchild = create_issue!(:parent_issue_id => child.id)
141 149
142 150 child.reload
143 151 child.project = Project.find(2)
144 152 assert child.save
145 153 child.reload
146 154 grandchild.reload
147 155 parent1.reload
148 156
149 157 assert_equal [1, parent1.id, 1, 2], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
150 158 assert_equal [2, child.id, 1, 4], [child.project_id, child.root_id, child.lft, child.rgt]
151 159 assert_equal [2, child.id, 2, 3], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
152 160 end
153 161
154 162 def test_invalid_move_to_another_project
155 163 parent1 = create_issue!
156 164 child = create_issue!(:parent_issue_id => parent1.id)
157 165 grandchild = create_issue!(:parent_issue_id => child.id, :tracker_id => 2)
158 166 Project.find(2).tracker_ids = [1]
159 167
160 168 parent1.reload
161 169 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
162 170
163 171 # child can not be moved to Project 2 because its child is on a disabled tracker
164 172 child = Issue.find(child.id)
165 173 child.project = Project.find(2)
166 174 assert !child.save
167 175 child.reload
168 176 grandchild.reload
169 177 parent1.reload
170 178
171 179 # no change
172 180 assert_equal [1, parent1.id, 1, 6], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
173 181 assert_equal [1, parent1.id, 2, 5], [child.project_id, child.root_id, child.lft, child.rgt]
174 182 assert_equal [1, parent1.id, 3, 4], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
175 183 end
176 184
177 185 def test_moving_an_issue_to_a_descendant_should_not_validate
178 186 parent1 = create_issue!
179 187 parent2 = create_issue!
180 188 child = create_issue!(:parent_issue_id => parent1.id)
181 189 grandchild = create_issue!(:parent_issue_id => child.id)
182 190
183 191 child.reload
184 192 child.parent_issue_id = grandchild.id
185 193 assert !child.save
186 194 assert_not_nil child.errors[:parent_issue_id]
187 195 end
188 196
189 197 def test_moving_an_issue_should_keep_valid_relations_only
190 198 issue1 = create_issue!
191 199 issue2 = create_issue!
192 200 issue3 = create_issue!(:parent_issue_id => issue2.id)
193 201 issue4 = create_issue!
194 202 r1 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
195 203 r2 = IssueRelation.create!(:issue_from => issue1, :issue_to => issue3, :relation_type => IssueRelation::TYPE_PRECEDES)
196 204 r3 = IssueRelation.create!(:issue_from => issue2, :issue_to => issue4, :relation_type => IssueRelation::TYPE_PRECEDES)
197 205 issue2.reload
198 206 issue2.parent_issue_id = issue1.id
199 207 issue2.save!
200 208 assert !IssueRelation.exists?(r1.id)
201 209 assert !IssueRelation.exists?(r2.id)
202 210 assert IssueRelation.exists?(r3.id)
203 211 end
204 212
205 213 def test_destroy_should_destroy_children
206 214 issue1 = create_issue!
207 215 issue2 = create_issue!
208 216 issue3 = create_issue!(:parent_issue_id => issue2.id)
209 217 issue4 = create_issue!(:parent_issue_id => issue1.id)
210 218
211 219 issue3.init_journal(User.find(2))
212 220 issue3.subject = 'child with journal'
213 221 issue3.save!
214 222
215 223 assert_difference 'Issue.count', -2 do
216 224 assert_difference 'Journal.count', -1 do
217 225 assert_difference 'JournalDetail.count', -1 do
218 226 Issue.find(issue2.id).destroy
219 227 end
220 228 end
221 229 end
222 230
223 231 issue1.reload
224 232 issue4.reload
225 233 assert !Issue.exists?(issue2.id)
226 234 assert !Issue.exists?(issue3.id)
227 235 assert_equal [issue1.id, 1, 4], [issue1.root_id, issue1.lft, issue1.rgt]
228 236 assert_equal [issue1.id, 2, 3], [issue4.root_id, issue4.lft, issue4.rgt]
229 237 end
230 238
231 239 def test_destroy_child_should_update_parent
232 240 issue = create_issue!
233 241 child1 = create_issue!(:parent_issue_id => issue.id)
234 242 child2 = create_issue!(:parent_issue_id => issue.id)
235 243
236 244 issue.reload
237 245 assert_equal [issue.id, 1, 6], [issue.root_id, issue.lft, issue.rgt]
238 246
239 247 child2.reload.destroy
240 248
241 249 issue.reload
242 250 assert_equal [issue.id, 1, 4], [issue.root_id, issue.lft, issue.rgt]
243 251 end
244 252
245 253 def test_destroy_parent_issue_updated_during_children_destroy
246 254 parent = create_issue!
247 255 create_issue!(:start_date => Date.today, :parent_issue_id => parent.id)
248 256 create_issue!(:start_date => 2.days.from_now, :parent_issue_id => parent.id)
249 257
250 258 assert_difference 'Issue.count', -3 do
251 259 Issue.find(parent.id).destroy
252 260 end
253 261 end
254 262
255 263 def test_destroy_child_issue_with_children
256 264 root = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'root')
257 265 child = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => root.id)
258 266 leaf = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'leaf', :parent_issue_id => child.id)
259 267 leaf.init_journal(User.find(2))
260 268 leaf.subject = 'leaf with journal'
261 269 leaf.save!
262 270
263 271 assert_difference 'Issue.count', -2 do
264 272 assert_difference 'Journal.count', -1 do
265 273 assert_difference 'JournalDetail.count', -1 do
266 274 Issue.find(child.id).destroy
267 275 end
268 276 end
269 277 end
270 278
271 279 root = Issue.find(root.id)
272 280 assert root.leaf?, "Root issue is not a leaf (lft: #{root.lft}, rgt: #{root.rgt})"
273 281 end
274 282
275 283 def test_destroy_issue_with_grand_child
276 284 parent = create_issue!
277 285 issue = create_issue!(:parent_issue_id => parent.id)
278 286 child = create_issue!(:parent_issue_id => issue.id)
279 287 grandchild1 = create_issue!(:parent_issue_id => child.id)
280 288 grandchild2 = create_issue!(:parent_issue_id => child.id)
281 289
282 290 assert_difference 'Issue.count', -4 do
283 291 Issue.find(issue.id).destroy
284 292 parent.reload
285 293 assert_equal [1, 2], [parent.lft, parent.rgt]
286 294 end
287 295 end
288 296
289 297 def test_parent_priority_should_be_the_highest_child_priority
290 298 parent = create_issue!(:priority => IssuePriority.find_by_name('Normal'))
291 299 # Create children
292 300 child1 = create_issue!(:priority => IssuePriority.find_by_name('High'), :parent_issue_id => parent.id)
293 301 assert_equal 'High', parent.reload.priority.name
294 302 child2 = create_issue!(:priority => IssuePriority.find_by_name('Immediate'), :parent_issue_id => child1.id)
295 303 assert_equal 'Immediate', child1.reload.priority.name
296 304 assert_equal 'Immediate', parent.reload.priority.name
297 305 child3 = create_issue!(:priority => IssuePriority.find_by_name('Low'), :parent_issue_id => parent.id)
298 306 assert_equal 'Immediate', parent.reload.priority.name
299 307 # Destroy a child
300 308 child1.destroy
301 309 assert_equal 'Low', parent.reload.priority.name
302 310 # Update a child
303 311 child3.reload.priority = IssuePriority.find_by_name('Normal')
304 312 child3.save!
305 313 assert_equal 'Normal', parent.reload.priority.name
306 314 end
307 315
308 316 def test_parent_dates_should_be_lowest_start_and_highest_due_dates
309 317 parent = create_issue!
310 318 create_issue!(:start_date => '2010-01-25', :due_date => '2010-02-15', :parent_issue_id => parent.id)
311 319 create_issue!( :due_date => '2010-02-13', :parent_issue_id => parent.id)
312 320 create_issue!(:start_date => '2010-02-01', :due_date => '2010-02-22', :parent_issue_id => parent.id)
313 321 parent.reload
314 322 assert_equal Date.parse('2010-01-25'), parent.start_date
315 323 assert_equal Date.parse('2010-02-22'), parent.due_date
316 324 end
317 325
318 326 def test_parent_done_ratio_should_be_average_done_ratio_of_leaves
319 327 parent = create_issue!
320 328 create_issue!(:done_ratio => 20, :parent_issue_id => parent.id)
321 329 assert_equal 20, parent.reload.done_ratio
322 330 create_issue!(:done_ratio => 70, :parent_issue_id => parent.id)
323 331 assert_equal 45, parent.reload.done_ratio
324 332
325 333 child = create_issue!(:done_ratio => 0, :parent_issue_id => parent.id)
326 334 assert_equal 30, parent.reload.done_ratio
327 335
328 336 create_issue!(:done_ratio => 30, :parent_issue_id => child.id)
329 337 assert_equal 30, child.reload.done_ratio
330 338 assert_equal 40, parent.reload.done_ratio
331 339 end
332 340
333 341 def test_parent_done_ratio_should_be_weighted_by_estimated_times_if_any
334 342 parent = create_issue!
335 343 create_issue!(:estimated_hours => 10, :done_ratio => 20, :parent_issue_id => parent.id)
336 344 assert_equal 20, parent.reload.done_ratio
337 345 create_issue!(:estimated_hours => 20, :done_ratio => 50, :parent_issue_id => parent.id)
338 346 assert_equal (50 * 20 + 20 * 10) / 30, parent.reload.done_ratio
339 347 end
340 348
341 349 def test_parent_estimate_should_be_sum_of_leaves
342 350 parent = create_issue!
343 351 create_issue!(:estimated_hours => nil, :parent_issue_id => parent.id)
344 352 assert_equal nil, parent.reload.estimated_hours
345 353 create_issue!(:estimated_hours => 5, :parent_issue_id => parent.id)
346 354 assert_equal 5, parent.reload.estimated_hours
347 355 create_issue!(:estimated_hours => 7, :parent_issue_id => parent.id)
348 356 assert_equal 12, parent.reload.estimated_hours
349 357 end
350 358
351 359 def test_move_parent_updates_old_parent_attributes
352 360 first_parent = create_issue!
353 361 second_parent = create_issue!
354 362 child = create_issue!(:estimated_hours => 5, :parent_issue_id => first_parent.id)
355 363 assert_equal 5, first_parent.reload.estimated_hours
356 364 child.update_attributes(:estimated_hours => 7, :parent_issue_id => second_parent.id)
357 365 assert_equal 7, second_parent.reload.estimated_hours
358 366 assert_nil first_parent.reload.estimated_hours
359 367 end
360 368
361 369 def test_reschuling_a_parent_should_reschedule_subtasks
362 370 parent = create_issue!
363 371 c1 = create_issue!(:start_date => '2010-05-12', :due_date => '2010-05-18', :parent_issue_id => parent.id)
364 372 c2 = create_issue!(:start_date => '2010-06-03', :due_date => '2010-06-10', :parent_issue_id => parent.id)
365 373 parent.reload
366 374 parent.reschedule_after(Date.parse('2010-06-02'))
367 375 c1.reload
368 376 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-08')], [c1.start_date, c1.due_date]
369 377 c2.reload
370 378 assert_equal [Date.parse('2010-06-03'), Date.parse('2010-06-10')], [c2.start_date, c2.due_date] # no change
371 379 parent.reload
372 380 assert_equal [Date.parse('2010-06-02'), Date.parse('2010-06-10')], [parent.start_date, parent.due_date]
373 381 end
374 382
375 383 def test_project_copy_should_copy_issue_tree
376 384 p = Project.create!(:name => 'Tree copy', :identifier => 'tree-copy', :tracker_ids => [1, 2])
377 385 i1 = create_issue!(:project_id => p.id, :subject => 'i1')
378 386 i2 = create_issue!(:project_id => p.id, :subject => 'i2', :parent_issue_id => i1.id)
379 387 i3 = create_issue!(:project_id => p.id, :subject => 'i3', :parent_issue_id => i1.id)
380 388 i4 = create_issue!(:project_id => p.id, :subject => 'i4', :parent_issue_id => i2.id)
381 389 i5 = create_issue!(:project_id => p.id, :subject => 'i5')
382 390 c = Project.new(:name => 'Copy', :identifier => 'copy', :tracker_ids => [1, 2])
383 391 c.copy(p, :only => 'issues')
384 392 c.reload
385 393
386 394 assert_equal 5, c.issues.count
387 395 ic1, ic2, ic3, ic4, ic5 = c.issues.find(:all, :order => 'subject')
388 396 assert ic1.root?
389 397 assert_equal ic1, ic2.parent
390 398 assert_equal ic1, ic3.parent
391 399 assert_equal ic2, ic4.parent
392 400 assert ic5.root?
393 401 end
394 402
395 403 # Helper that creates an issue with default attributes
396 404 def create_issue!(attributes={})
397 405 Issue.create!({:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'test'}.merge(attributes))
398 406 end
399 407 end
@@ -1,1592 +1,1652
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class IssueTest < ActiveSupport::TestCase
21 21 fixtures :projects, :users, :members, :member_roles, :roles,
22 22 :groups_users,
23 23 :trackers, :projects_trackers,
24 24 :enabled_modules,
25 25 :versions,
26 26 :issue_statuses, :issue_categories, :issue_relations, :workflows,
27 27 :enumerations,
28 28 :issues, :journals, :journal_details,
29 29 :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
30 30 :time_entries
31 31
32 32 include Redmine::I18n
33 33
34 34 def teardown
35 35 User.current = nil
36 36 end
37 37
38 38 def test_create
39 39 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
40 40 :status_id => 1, :priority => IssuePriority.all.first,
41 41 :subject => 'test_create',
42 42 :description => 'IssueTest#test_create', :estimated_hours => '1:30')
43 43 assert issue.save
44 44 issue.reload
45 45 assert_equal 1.5, issue.estimated_hours
46 46 end
47 47
48 48 def test_create_minimal
49 49 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3,
50 50 :status_id => 1, :priority => IssuePriority.all.first,
51 51 :subject => 'test_create')
52 52 assert issue.save
53 53 assert issue.description.nil?
54 54 assert_nil issue.estimated_hours
55 55 end
56 56
57 57 def test_create_with_required_custom_field
58 58 set_language_if_valid 'en'
59 59 field = IssueCustomField.find_by_name('Database')
60 60 field.update_attribute(:is_required, true)
61 61
62 62 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
63 63 :status_id => 1, :subject => 'test_create',
64 64 :description => 'IssueTest#test_create_with_required_custom_field')
65 65 assert issue.available_custom_fields.include?(field)
66 66 # No value for the custom field
67 67 assert !issue.save
68 68 assert_equal ["Database can't be blank"], issue.errors.full_messages
69 69 # Blank value
70 70 issue.custom_field_values = { field.id => '' }
71 71 assert !issue.save
72 72 assert_equal ["Database can't be blank"], issue.errors.full_messages
73 73 # Invalid value
74 74 issue.custom_field_values = { field.id => 'SQLServer' }
75 75 assert !issue.save
76 76 assert_equal ["Database is not included in the list"], issue.errors.full_messages
77 77 # Valid value
78 78 issue.custom_field_values = { field.id => 'PostgreSQL' }
79 79 assert issue.save
80 80 issue.reload
81 81 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
82 82 end
83 83
84 84 def test_create_with_group_assignment
85 85 with_settings :issue_group_assignment => '1' do
86 86 assert Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
87 87 :subject => 'Group assignment',
88 88 :assigned_to_id => 11).save
89 89 issue = Issue.first(:order => 'id DESC')
90 90 assert_kind_of Group, issue.assigned_to
91 91 assert_equal Group.find(11), issue.assigned_to
92 92 end
93 93 end
94 94
95 95 def assert_visibility_match(user, issues)
96 96 assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
97 97 end
98 98
99 99 def test_visible_scope_for_anonymous
100 100 # Anonymous user should see issues of public projects only
101 101 issues = Issue.visible(User.anonymous).all
102 102 assert issues.any?
103 103 assert_nil issues.detect {|issue| !issue.project.is_public?}
104 104 assert_nil issues.detect {|issue| issue.is_private?}
105 105 assert_visibility_match User.anonymous, issues
106 106 end
107 107
108 108 def test_visible_scope_for_anonymous_without_view_issues_permissions
109 109 # Anonymous user should not see issues without permission
110 110 Role.anonymous.remove_permission!(:view_issues)
111 111 issues = Issue.visible(User.anonymous).all
112 112 assert issues.empty?
113 113 assert_visibility_match User.anonymous, issues
114 114 end
115 115
116 116 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_default
117 117 assert Role.anonymous.update_attribute(:issues_visibility, 'default')
118 118 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
119 119 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
120 120 assert !issue.visible?(User.anonymous)
121 121 end
122 122
123 123 def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_own
124 124 assert Role.anonymous.update_attribute(:issues_visibility, 'own')
125 125 issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
126 126 assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
127 127 assert !issue.visible?(User.anonymous)
128 128 end
129 129
130 130 def test_visible_scope_for_non_member
131 131 user = User.find(9)
132 132 assert user.projects.empty?
133 133 # Non member user should see issues of public projects only
134 134 issues = Issue.visible(user).all
135 135 assert issues.any?
136 136 assert_nil issues.detect {|issue| !issue.project.is_public?}
137 137 assert_nil issues.detect {|issue| issue.is_private?}
138 138 assert_visibility_match user, issues
139 139 end
140 140
141 141 def test_visible_scope_for_non_member_with_own_issues_visibility
142 142 Role.non_member.update_attribute :issues_visibility, 'own'
143 143 Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 9, :subject => 'Issue by non member')
144 144 user = User.find(9)
145 145
146 146 issues = Issue.visible(user).all
147 147 assert issues.any?
148 148 assert_nil issues.detect {|issue| issue.author != user}
149 149 assert_visibility_match user, issues
150 150 end
151 151
152 152 def test_visible_scope_for_non_member_without_view_issues_permissions
153 153 # Non member user should not see issues without permission
154 154 Role.non_member.remove_permission!(:view_issues)
155 155 user = User.find(9)
156 156 assert user.projects.empty?
157 157 issues = Issue.visible(user).all
158 158 assert issues.empty?
159 159 assert_visibility_match user, issues
160 160 end
161 161
162 162 def test_visible_scope_for_member
163 163 user = User.find(9)
164 164 # User should see issues of projects for which he has view_issues permissions only
165 165 Role.non_member.remove_permission!(:view_issues)
166 166 Member.create!(:principal => user, :project_id => 3, :role_ids => [2])
167 167 issues = Issue.visible(user).all
168 168 assert issues.any?
169 169 assert_nil issues.detect {|issue| issue.project_id != 3}
170 170 assert_nil issues.detect {|issue| issue.is_private?}
171 171 assert_visibility_match user, issues
172 172 end
173 173
174 174 def test_visible_scope_for_member_with_groups_should_return_assigned_issues
175 175 user = User.find(8)
176 176 assert user.groups.any?
177 177 Member.create!(:principal => user.groups.first, :project_id => 1, :role_ids => [2])
178 178 Role.non_member.remove_permission!(:view_issues)
179 179
180 180 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
181 181 :status_id => 1, :priority => IssuePriority.all.first,
182 182 :subject => 'Assignment test',
183 183 :assigned_to => user.groups.first,
184 184 :is_private => true)
185 185
186 186 Role.find(2).update_attribute :issues_visibility, 'default'
187 187 issues = Issue.visible(User.find(8)).all
188 188 assert issues.any?
189 189 assert issues.include?(issue)
190 190
191 191 Role.find(2).update_attribute :issues_visibility, 'own'
192 192 issues = Issue.visible(User.find(8)).all
193 193 assert issues.any?
194 194 assert issues.include?(issue)
195 195 end
196 196
197 197 def test_visible_scope_for_admin
198 198 user = User.find(1)
199 199 user.members.each(&:destroy)
200 200 assert user.projects.empty?
201 201 issues = Issue.visible(user).all
202 202 assert issues.any?
203 203 # Admin should see issues on private projects that he does not belong to
204 204 assert issues.detect {|issue| !issue.project.is_public?}
205 205 # Admin should see private issues of other users
206 206 assert issues.detect {|issue| issue.is_private? && issue.author != user}
207 207 assert_visibility_match user, issues
208 208 end
209 209
210 210 def test_visible_scope_with_project
211 211 project = Project.find(1)
212 212 issues = Issue.visible(User.find(2), :project => project).all
213 213 projects = issues.collect(&:project).uniq
214 214 assert_equal 1, projects.size
215 215 assert_equal project, projects.first
216 216 end
217 217
218 218 def test_visible_scope_with_project_and_subprojects
219 219 project = Project.find(1)
220 220 issues = Issue.visible(User.find(2), :project => project, :with_subprojects => true).all
221 221 projects = issues.collect(&:project).uniq
222 222 assert projects.size > 1
223 223 assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
224 224 end
225 225
226 226 def test_visible_and_nested_set_scopes
227 227 assert_equal 0, Issue.find(1).descendants.visible.all.size
228 228 end
229 229
230 230 def test_open_scope
231 231 issues = Issue.open.all
232 232 assert_nil issues.detect(&:closed?)
233 233 end
234 234
235 235 def test_open_scope_with_arg
236 236 issues = Issue.open(false).all
237 237 assert_equal issues, issues.select(&:closed?)
238 238 end
239 239
240 240 def test_errors_full_messages_should_include_custom_fields_errors
241 241 field = IssueCustomField.find_by_name('Database')
242 242
243 243 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
244 244 :status_id => 1, :subject => 'test_create',
245 245 :description => 'IssueTest#test_create_with_required_custom_field')
246 246 assert issue.available_custom_fields.include?(field)
247 247 # Invalid value
248 248 issue.custom_field_values = { field.id => 'SQLServer' }
249 249
250 250 assert !issue.valid?
251 251 assert_equal 1, issue.errors.full_messages.size
252 252 assert_equal "Database #{I18n.translate('activerecord.errors.messages.inclusion')}",
253 253 issue.errors.full_messages.first
254 254 end
255 255
256 256 def test_update_issue_with_required_custom_field
257 257 field = IssueCustomField.find_by_name('Database')
258 258 field.update_attribute(:is_required, true)
259 259
260 260 issue = Issue.find(1)
261 261 assert_nil issue.custom_value_for(field)
262 262 assert issue.available_custom_fields.include?(field)
263 263 # No change to custom values, issue can be saved
264 264 assert issue.save
265 265 # Blank value
266 266 issue.custom_field_values = { field.id => '' }
267 267 assert !issue.save
268 268 # Valid value
269 269 issue.custom_field_values = { field.id => 'PostgreSQL' }
270 270 assert issue.save
271 271 issue.reload
272 272 assert_equal 'PostgreSQL', issue.custom_value_for(field).value
273 273 end
274 274
275 275 def test_should_not_update_attributes_if_custom_fields_validation_fails
276 276 issue = Issue.find(1)
277 277 field = IssueCustomField.find_by_name('Database')
278 278 assert issue.available_custom_fields.include?(field)
279 279
280 280 issue.custom_field_values = { field.id => 'Invalid' }
281 281 issue.subject = 'Should be not be saved'
282 282 assert !issue.save
283 283
284 284 issue.reload
285 285 assert_equal "Can't print recipes", issue.subject
286 286 end
287 287
288 288 def test_should_not_recreate_custom_values_objects_on_update
289 289 field = IssueCustomField.find_by_name('Database')
290 290
291 291 issue = Issue.find(1)
292 292 issue.custom_field_values = { field.id => 'PostgreSQL' }
293 293 assert issue.save
294 294 custom_value = issue.custom_value_for(field)
295 295 issue.reload
296 296 issue.custom_field_values = { field.id => 'MySQL' }
297 297 assert issue.save
298 298 issue.reload
299 299 assert_equal custom_value.id, issue.custom_value_for(field).id
300 300 end
301 301
302 302 def test_should_not_update_custom_fields_on_changing_tracker_with_different_custom_fields
303 303 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => 'Test', :custom_field_values => {'2' => 'Test'})
304 304 assert !Tracker.find(2).custom_field_ids.include?(2)
305 305
306 306 issue = Issue.find(issue.id)
307 307 issue.attributes = {:tracker_id => 2, :custom_field_values => {'1' => ''}}
308 308
309 309 issue = Issue.find(issue.id)
310 310 custom_value = issue.custom_value_for(2)
311 311 assert_not_nil custom_value
312 312 assert_equal 'Test', custom_value.value
313 313 end
314 314
315 315 def test_assigning_tracker_id_should_reload_custom_fields_values
316 316 issue = Issue.new(:project => Project.find(1))
317 317 assert issue.custom_field_values.empty?
318 318 issue.tracker_id = 1
319 319 assert issue.custom_field_values.any?
320 320 end
321 321
322 322 def test_assigning_attributes_should_assign_project_and_tracker_first
323 323 seq = sequence('seq')
324 324 issue = Issue.new
325 325 issue.expects(:project_id=).in_sequence(seq)
326 326 issue.expects(:tracker_id=).in_sequence(seq)
327 327 issue.expects(:subject=).in_sequence(seq)
328 328 issue.attributes = {:tracker_id => 2, :project_id => 1, :subject => 'Test'}
329 329 end
330 330
331 331 def test_assigning_tracker_and_custom_fields_should_assign_custom_fields
332 332 attributes = ActiveSupport::OrderedHash.new
333 333 attributes['custom_field_values'] = { '1' => 'MySQL' }
334 334 attributes['tracker_id'] = '1'
335 335 issue = Issue.new(:project => Project.find(1))
336 336 issue.attributes = attributes
337 337 assert_equal 'MySQL', issue.custom_field_value(1)
338 338 end
339 339
340 340 def test_should_update_issue_with_disabled_tracker
341 341 p = Project.find(1)
342 342 issue = Issue.find(1)
343 343
344 344 p.trackers.delete(issue.tracker)
345 345 assert !p.trackers.include?(issue.tracker)
346 346
347 347 issue.reload
348 348 issue.subject = 'New subject'
349 349 assert issue.save
350 350 end
351 351
352 352 def test_should_not_set_a_disabled_tracker
353 353 p = Project.find(1)
354 354 p.trackers.delete(Tracker.find(2))
355 355
356 356 issue = Issue.find(1)
357 357 issue.tracker_id = 2
358 358 issue.subject = 'New subject'
359 359 assert !issue.save
360 360 assert_not_nil issue.errors[:tracker_id]
361 361 end
362 362
363 363 def test_category_based_assignment
364 364 issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3,
365 365 :status_id => 1, :priority => IssuePriority.all.first,
366 366 :subject => 'Assignment test',
367 367 :description => 'Assignment test', :category_id => 1)
368 368 assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to
369 369 end
370 370
371 371 def test_new_statuses_allowed_to
372 372 WorkflowTransition.delete_all
373 373
374 374 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
375 375 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
376 376 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
377 377 WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
378 378 status = IssueStatus.find(1)
379 379 role = Role.find(1)
380 380 tracker = Tracker.find(1)
381 381 user = User.find(2)
382 382
383 383 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1)
384 384 assert_equal [1, 2], issue.new_statuses_allowed_to(user).map(&:id)
385 385
386 386 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user)
387 387 assert_equal [1, 2, 3, 5], issue.new_statuses_allowed_to(user).map(&:id)
388 388
389 389 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1, :assigned_to => user)
390 390 assert_equal [1, 2, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
391 391
392 392 issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user, :assigned_to => user)
393 393 assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
394 394 end
395 395
396 396 def test_new_statuses_allowed_to_should_return_all_transitions_for_admin
397 397 admin = User.find(1)
398 398 issue = Issue.find(1)
399 399 assert !admin.member_of?(issue.project)
400 400 expected_statuses = [issue.status] + WorkflowTransition.find_all_by_old_status_id(issue.status_id).map(&:new_status).uniq.sort
401 401
402 402 assert_equal expected_statuses, issue.new_statuses_allowed_to(admin)
403 403 end
404 404
405 405 def test_new_statuses_allowed_to_should_return_default_and_current_status_when_copying
406 406 issue = Issue.find(1).copy
407 407 assert_equal [1], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
408 408
409 409 issue = Issue.find(2).copy
410 410 assert_equal [1, 2], issue.new_statuses_allowed_to(User.find(2)).map(&:id)
411 411 end
412 412
413 413 def test_safe_attributes_names_should_not_include_disabled_field
414 414 tracker = Tracker.new(:core_fields => %w(assigned_to_id fixed_version_id))
415 415
416 416 issue = Issue.new(:tracker => tracker)
417 417 assert_include 'tracker_id', issue.safe_attribute_names
418 418 assert_include 'status_id', issue.safe_attribute_names
419 419 assert_include 'subject', issue.safe_attribute_names
420 420 assert_include 'description', issue.safe_attribute_names
421 421 assert_include 'custom_field_values', issue.safe_attribute_names
422 422 assert_include 'custom_fields', issue.safe_attribute_names
423 423 assert_include 'lock_version', issue.safe_attribute_names
424 424
425 425 tracker.core_fields.each do |field|
426 426 assert_include field, issue.safe_attribute_names
427 427 end
428 428
429 429 tracker.disabled_core_fields.each do |field|
430 430 assert_not_include field, issue.safe_attribute_names
431 431 end
432 432 end
433 433
434 434 def test_safe_attributes_should_ignore_disabled_fields
435 435 tracker = Tracker.find(1)
436 436 tracker.core_fields = %w(assigned_to_id due_date)
437 437 tracker.save!
438 438
439 439 issue = Issue.new(:tracker => tracker)
440 440 issue.safe_attributes = {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}
441 441 assert_nil issue.start_date
442 442 assert_equal Date.parse('2012-07-14'), issue.due_date
443 443 end
444 444
445 445 def test_safe_attributes_should_accept_target_tracker_enabled_fields
446 446 source = Tracker.find(1)
447 447 source.core_fields = []
448 448 source.save!
449 449 target = Tracker.find(2)
450 450 target.core_fields = %w(assigned_to_id due_date)
451 451 target.save!
452 452
453 453 issue = Issue.new(:tracker => source)
454 454 issue.safe_attributes = {'tracker_id' => 2, 'due_date' => '2012-07-14'}
455 455 assert_equal target, issue.tracker
456 456 assert_equal Date.parse('2012-07-14'), issue.due_date
457 457 end
458 458
459 459 def test_safe_attributes_should_not_include_readonly_fields
460 460 WorkflowPermission.delete_all
461 461 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
462 462 user = User.find(2)
463 463
464 464 issue = Issue.new(:project_id => 1, :tracker_id => 1)
465 465 assert_equal %w(due_date), issue.read_only_attribute_names(user)
466 466 assert_not_include 'due_date', issue.safe_attribute_names(user)
467 467
468 468 issue.send :safe_attributes=, {'start_date' => '2012-07-14', 'due_date' => '2012-07-14'}, user
469 469 assert_equal Date.parse('2012-07-14'), issue.start_date
470 470 assert_nil issue.due_date
471 471 end
472 472
473 473 def test_safe_attributes_should_not_include_readonly_custom_fields
474 474 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
475 475 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1])
476 476
477 477 WorkflowPermission.delete_all
478 478 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
479 479 user = User.find(2)
480 480
481 481 issue = Issue.new(:project_id => 1, :tracker_id => 1)
482 482 assert_equal [cf2.id.to_s], issue.read_only_attribute_names(user)
483 483 assert_not_include cf2.id.to_s, issue.safe_attribute_names(user)
484 484
485 485 issue.send :safe_attributes=, {'custom_field_values' => {cf1.id.to_s => 'value1', cf2.id.to_s => 'value2'}}, user
486 486 assert_equal 'value1', issue.custom_field_value(cf1)
487 487 assert_nil issue.custom_field_value(cf2)
488 488
489 489 issue.send :safe_attributes=, {'custom_fields' => [{'id' => cf1.id.to_s, 'value' => 'valuea'}, {'id' => cf2.id.to_s, 'value' => 'valueb'}]}, user
490 490 assert_equal 'valuea', issue.custom_field_value(cf1)
491 491 assert_nil issue.custom_field_value(cf2)
492 492 end
493 493
494 494 def test_editable_custom_field_values_should_return_non_readonly_custom_values
495 495 cf1 = IssueCustomField.create!(:name => 'Writable field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
496 496 cf2 = IssueCustomField.create!(:name => 'Readonly field', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
497 497
498 498 WorkflowPermission.delete_all
499 499 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf2.id.to_s, :rule => 'readonly')
500 500 user = User.find(2)
501 501
502 502 issue = Issue.new(:project_id => 1, :tracker_id => 1)
503 503 values = issue.editable_custom_field_values(user)
504 504 assert values.detect {|value| value.custom_field == cf1}
505 505 assert_nil values.detect {|value| value.custom_field == cf2}
506 506
507 507 issue.tracker_id = 2
508 508 values = issue.editable_custom_field_values(user)
509 509 assert values.detect {|value| value.custom_field == cf1}
510 510 assert values.detect {|value| value.custom_field == cf2}
511 511 end
512 512
513 513 def test_safe_attributes_should_accept_target_tracker_writable_fields
514 514 WorkflowPermission.delete_all
515 515 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
516 516 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
517 517 user = User.find(2)
518 518
519 519 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
520 520
521 521 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
522 522 assert_equal Date.parse('2012-07-12'), issue.start_date
523 523 assert_nil issue.due_date
524 524
525 525 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'tracker_id' => 2}, user
526 526 assert_equal Date.parse('2012-07-12'), issue.start_date
527 527 assert_equal Date.parse('2012-07-16'), issue.due_date
528 528 end
529 529
530 530 def test_safe_attributes_should_accept_target_status_writable_fields
531 531 WorkflowPermission.delete_all
532 532 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
533 533 WorkflowPermission.create!(:old_status_id => 2, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
534 534 user = User.find(2)
535 535
536 536 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
537 537
538 538 issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user
539 539 assert_equal Date.parse('2012-07-12'), issue.start_date
540 540 assert_nil issue.due_date
541 541
542 542 issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'status_id' => 2}, user
543 543 assert_equal Date.parse('2012-07-12'), issue.start_date
544 544 assert_equal Date.parse('2012-07-16'), issue.due_date
545 545 end
546 546
547 547 def test_required_attributes_should_be_validated
548 548 cf = IssueCustomField.create!(:name => 'Foo', :field_format => 'string', :is_for_all => true, :tracker_ids => [1, 2])
549 549
550 550 WorkflowPermission.delete_all
551 551 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
552 552 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'category_id', :rule => 'required')
553 553 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
554 554
555 555 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'required')
556 556 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => cf.id.to_s, :rule => 'required')
557 557 user = User.find(2)
558 558
559 559 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Required fields', :author => user)
560 560 assert_equal [cf.id.to_s, "category_id", "due_date"], issue.required_attribute_names(user).sort
561 561 assert !issue.save, "Issue was saved"
562 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 564 issue.tracker_id = 2
565 565 assert_equal [cf.id.to_s, "start_date"], issue.required_attribute_names(user).sort
566 566 assert !issue.save, "Issue was saved"
567 567 assert_equal ["Foo can't be blank", "Start date can't be blank"], issue.errors.full_messages.sort
568 568
569 569 issue.start_date = Date.today
570 570 issue.custom_field_values = {cf.id.to_s => 'bar'}
571 571 assert issue.save
572 572 end
573 573
574 574 def test_required_attribute_names_for_multiple_roles_should_intersect_rules
575 575 WorkflowPermission.delete_all
576 576 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'required')
577 577 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'required')
578 578 user = User.find(2)
579 579 member = Member.find(1)
580 580 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
581 581
582 582 assert_equal %w(due_date start_date), issue.required_attribute_names(user).sort
583 583
584 584 member.role_ids = [1, 2]
585 585 member.save!
586 586 assert_equal [], issue.required_attribute_names(user.reload)
587 587
588 588 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'required')
589 589 assert_equal %w(due_date), issue.required_attribute_names(user)
590 590
591 591 member.role_ids = [1, 2, 3]
592 592 member.save!
593 593 assert_equal [], issue.required_attribute_names(user.reload)
594 594
595 595 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
596 596 # required + readonly => required
597 597 assert_equal %w(due_date), issue.required_attribute_names(user)
598 598 end
599 599
600 600 def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules
601 601 WorkflowPermission.delete_all
602 602 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly')
603 603 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly')
604 604 user = User.find(2)
605 605 member = Member.find(1)
606 606 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
607 607
608 608 assert_equal %w(due_date start_date), issue.read_only_attribute_names(user).sort
609 609
610 610 member.role_ids = [1, 2]
611 611 member.save!
612 612 assert_equal [], issue.read_only_attribute_names(user.reload)
613 613
614 614 WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly')
615 615 assert_equal %w(due_date), issue.read_only_attribute_names(user)
616 616 end
617 617
618 618 def test_copy
619 619 issue = Issue.new.copy_from(1)
620 620 assert issue.copy?
621 621 assert issue.save
622 622 issue.reload
623 623 orig = Issue.find(1)
624 624 assert_equal orig.subject, issue.subject
625 625 assert_equal orig.tracker, issue.tracker
626 626 assert_equal "125", issue.custom_value_for(2).value
627 627 end
628 628
629 629 def test_copy_should_copy_status
630 630 orig = Issue.find(8)
631 631 assert orig.status != IssueStatus.default
632 632
633 633 issue = Issue.new.copy_from(orig)
634 634 assert issue.save
635 635 issue.reload
636 636 assert_equal orig.status, issue.status
637 637 end
638 638
639 639 def test_copy_should_add_relation_with_copied_issue
640 640 copied = Issue.find(1)
641 641 issue = Issue.new.copy_from(copied)
642 642 assert issue.save
643 643 issue.reload
644 644
645 645 assert_equal 1, issue.relations.size
646 646 relation = issue.relations.first
647 647 assert_equal 'copied_to', relation.relation_type
648 648 assert_equal copied, relation.issue_from
649 649 assert_equal issue, relation.issue_to
650 650 end
651 651
652 652 def test_copy_should_copy_subtasks
653 653 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
654 654
655 655 copy = issue.reload.copy
656 656 copy.author = User.find(7)
657 657 assert_difference 'Issue.count', 1+issue.descendants.count do
658 658 assert copy.save
659 659 end
660 660 copy.reload
661 661 assert_equal %w(Child1 Child2), copy.children.map(&:subject).sort
662 662 child_copy = copy.children.detect {|c| c.subject == 'Child1'}
663 663 assert_equal %w(Child11), child_copy.children.map(&:subject).sort
664 664 assert_equal copy.author, child_copy.author
665 665 end
666 666
667 667 def test_copy_should_copy_subtasks_to_target_project
668 668 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
669 669
670 670 copy = issue.copy(:project_id => 3)
671 671 assert_difference 'Issue.count', 1+issue.descendants.count do
672 672 assert copy.save
673 673 end
674 674 assert_equal [3], copy.reload.descendants.map(&:project_id).uniq
675 675 end
676 676
677 677 def test_copy_should_not_copy_subtasks_twice_when_saving_twice
678 678 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
679 679
680 680 copy = issue.reload.copy
681 681 assert_difference 'Issue.count', 1+issue.descendants.count do
682 682 assert copy.save
683 683 assert copy.save
684 684 end
685 685 end
686 686
687 687 def test_should_not_call_after_project_change_on_creation
688 688 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Test', :author_id => 1)
689 689 issue.expects(:after_project_change).never
690 690 issue.save!
691 691 end
692 692
693 693 def test_should_not_call_after_project_change_on_update
694 694 issue = Issue.find(1)
695 695 issue.project = Project.find(1)
696 696 issue.subject = 'No project change'
697 697 issue.expects(:after_project_change).never
698 698 issue.save!
699 699 end
700 700
701 701 def test_should_call_after_project_change_on_project_change
702 702 issue = Issue.find(1)
703 703 issue.project = Project.find(2)
704 704 issue.expects(:after_project_change).once
705 705 issue.save!
706 706 end
707 707
708 708 def test_adding_journal_should_update_timestamp
709 709 issue = Issue.find(1)
710 710 updated_on_was = issue.updated_on
711 711
712 712 issue.init_journal(User.first, "Adding notes")
713 713 assert_difference 'Journal.count' do
714 714 assert issue.save
715 715 end
716 716 issue.reload
717 717
718 718 assert_not_equal updated_on_was, issue.updated_on
719 719 end
720 720
721 721 def test_should_close_duplicates
722 722 # Create 3 issues
723 723 project = Project.find(1)
724 724 issue1 = Issue.generate_for_project!(project)
725 725 issue2 = Issue.generate_for_project!(project)
726 726 issue3 = Issue.generate_for_project!(project)
727 727
728 728 # 2 is a dupe of 1
729 729 IssueRelation.create!(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
730 730 # And 3 is a dupe of 2
731 731 IssueRelation.create!(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
732 732 # And 3 is a dupe of 1 (circular duplicates)
733 733 IssueRelation.create!(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
734 734
735 735 assert issue1.reload.duplicates.include?(issue2)
736 736
737 737 # Closing issue 1
738 738 issue1.init_journal(User.find(:first), "Closing issue1")
739 739 issue1.status = IssueStatus.find :first, :conditions => {:is_closed => true}
740 740 assert issue1.save
741 741 # 2 and 3 should be also closed
742 742 assert issue2.reload.closed?
743 743 assert issue3.reload.closed?
744 744 end
745 745
746 746 def test_should_not_close_duplicated_issue
747 747 project = Project.find(1)
748 748 issue1 = Issue.generate_for_project!(project)
749 749 issue2 = Issue.generate_for_project!(project)
750 750
751 751 # 2 is a dupe of 1
752 752 IssueRelation.create(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
753 753 # 2 is a dup of 1 but 1 is not a duplicate of 2
754 754 assert !issue2.reload.duplicates.include?(issue1)
755 755
756 756 # Closing issue 2
757 757 issue2.init_journal(User.find(:first), "Closing issue2")
758 758 issue2.status = IssueStatus.find :first, :conditions => {:is_closed => true}
759 759 assert issue2.save
760 760 # 1 should not be also closed
761 761 assert !issue1.reload.closed?
762 762 end
763 763
764 764 def test_assignable_versions
765 765 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
766 766 assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq
767 767 end
768 768
769 769 def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version
770 770 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
771 771 assert !issue.save
772 772 assert_not_nil issue.errors[:fixed_version_id]
773 773 end
774 774
775 775 def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version
776 776 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 2, :subject => 'New issue')
777 777 assert !issue.save
778 778 assert_not_nil issue.errors[:fixed_version_id]
779 779 end
780 780
781 781 def test_should_be_able_to_assign_a_new_issue_to_an_open_version
782 782 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 3, :subject => 'New issue')
783 783 assert issue.save
784 784 end
785 785
786 786 def test_should_be_able_to_update_an_issue_assigned_to_a_closed_version
787 787 issue = Issue.find(11)
788 788 assert_equal 'closed', issue.fixed_version.status
789 789 issue.subject = 'Subject changed'
790 790 assert issue.save
791 791 end
792 792
793 793 def test_should_not_be_able_to_reopen_an_issue_assigned_to_a_closed_version
794 794 issue = Issue.find(11)
795 795 issue.status_id = 1
796 796 assert !issue.save
797 797 assert_not_nil issue.errors[:base]
798 798 end
799 799
800 800 def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version
801 801 issue = Issue.find(11)
802 802 issue.status_id = 1
803 803 issue.fixed_version_id = 3
804 804 assert issue.save
805 805 end
806 806
807 807 def test_should_be_able_to_reopen_an_issue_assigned_to_a_locked_version
808 808 issue = Issue.find(12)
809 809 assert_equal 'locked', issue.fixed_version.status
810 810 issue.status_id = 1
811 811 assert issue.save
812 812 end
813 813
814 814 def test_should_not_be_able_to_keep_unshared_version_when_changing_project
815 815 issue = Issue.find(2)
816 816 assert_equal 2, issue.fixed_version_id
817 817 issue.project_id = 3
818 818 assert_nil issue.fixed_version_id
819 819 issue.fixed_version_id = 2
820 820 assert !issue.save
821 821 assert_include 'Target version is not included in the list', issue.errors.full_messages
822 822 end
823 823
824 824 def test_should_keep_shared_version_when_changing_project
825 825 Version.find(2).update_attribute :sharing, 'tree'
826 826
827 827 issue = Issue.find(2)
828 828 assert_equal 2, issue.fixed_version_id
829 829 issue.project_id = 3
830 830 assert_equal 2, issue.fixed_version_id
831 831 assert issue.save
832 832 end
833 833
834 834 def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled
835 835 assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
836 836 end
837 837
838 838 def test_allowed_target_projects_on_move_should_not_include_projects_with_issue_tracking_disabled
839 839 Project.find(2).disable_module! :issue_tracking
840 840 assert_not_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
841 841 end
842 842
843 843 def test_move_to_another_project_with_same_category
844 844 issue = Issue.find(1)
845 845 issue.project = Project.find(2)
846 846 assert issue.save
847 847 issue.reload
848 848 assert_equal 2, issue.project_id
849 849 # Category changes
850 850 assert_equal 4, issue.category_id
851 851 # Make sure time entries were move to the target project
852 852 assert_equal 2, issue.time_entries.first.project_id
853 853 end
854 854
855 855 def test_move_to_another_project_without_same_category
856 856 issue = Issue.find(2)
857 857 issue.project = Project.find(2)
858 858 assert issue.save
859 859 issue.reload
860 860 assert_equal 2, issue.project_id
861 861 # Category cleared
862 862 assert_nil issue.category_id
863 863 end
864 864
865 865 def test_move_to_another_project_should_clear_fixed_version_when_not_shared
866 866 issue = Issue.find(1)
867 867 issue.update_attribute(:fixed_version_id, 1)
868 868 issue.project = Project.find(2)
869 869 assert issue.save
870 870 issue.reload
871 871 assert_equal 2, issue.project_id
872 872 # Cleared fixed_version
873 873 assert_equal nil, issue.fixed_version
874 874 end
875 875
876 876 def test_move_to_another_project_should_keep_fixed_version_when_shared_with_the_target_project
877 877 issue = Issue.find(1)
878 878 issue.update_attribute(:fixed_version_id, 4)
879 879 issue.project = Project.find(5)
880 880 assert issue.save
881 881 issue.reload
882 882 assert_equal 5, issue.project_id
883 883 # Keep fixed_version
884 884 assert_equal 4, issue.fixed_version_id
885 885 end
886 886
887 887 def test_move_to_another_project_should_clear_fixed_version_when_not_shared_with_the_target_project
888 888 issue = Issue.find(1)
889 889 issue.update_attribute(:fixed_version_id, 1)
890 890 issue.project = Project.find(5)
891 891 assert issue.save
892 892 issue.reload
893 893 assert_equal 5, issue.project_id
894 894 # Cleared fixed_version
895 895 assert_equal nil, issue.fixed_version
896 896 end
897 897
898 898 def test_move_to_another_project_should_keep_fixed_version_when_shared_systemwide
899 899 issue = Issue.find(1)
900 900 issue.update_attribute(:fixed_version_id, 7)
901 901 issue.project = Project.find(2)
902 902 assert issue.save
903 903 issue.reload
904 904 assert_equal 2, issue.project_id
905 905 # Keep fixed_version
906 906 assert_equal 7, issue.fixed_version_id
907 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 927 def test_move_to_another_project_with_disabled_tracker
910 928 issue = Issue.find(1)
911 929 target = Project.find(2)
912 930 target.tracker_ids = [3]
913 931 target.save
914 932 issue.project = target
915 933 assert issue.save
916 934 issue.reload
917 935 assert_equal 2, issue.project_id
918 936 assert_equal 3, issue.tracker_id
919 937 end
920 938
921 939 def test_copy_to_the_same_project
922 940 issue = Issue.find(1)
923 941 copy = issue.copy
924 942 assert_difference 'Issue.count' do
925 943 copy.save!
926 944 end
927 945 assert_kind_of Issue, copy
928 946 assert_equal issue.project, copy.project
929 947 assert_equal "125", copy.custom_value_for(2).value
930 948 end
931 949
932 950 def test_copy_to_another_project_and_tracker
933 951 issue = Issue.find(1)
934 952 copy = issue.copy(:project_id => 3, :tracker_id => 2)
935 953 assert_difference 'Issue.count' do
936 954 copy.save!
937 955 end
938 956 copy.reload
939 957 assert_kind_of Issue, copy
940 958 assert_equal Project.find(3), copy.project
941 959 assert_equal Tracker.find(2), copy.tracker
942 960 # Custom field #2 is not associated with target tracker
943 961 assert_nil copy.custom_value_for(2)
944 962 end
945 963
946 964 context "#copy" do
947 965 setup do
948 966 @issue = Issue.find(1)
949 967 end
950 968
951 969 should "not create a journal" do
952 970 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
953 971 copy.save!
954 972 assert_equal 0, copy.reload.journals.size
955 973 end
956 974
957 975 should "allow assigned_to changes" do
958 976 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
959 977 assert_equal 3, copy.assigned_to_id
960 978 end
961 979
962 980 should "allow status changes" do
963 981 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :status_id => 2)
964 982 assert_equal 2, copy.status_id
965 983 end
966 984
967 985 should "allow start date changes" do
968 986 date = Date.today
969 987 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
970 988 assert_equal date, copy.start_date
971 989 end
972 990
973 991 should "allow due date changes" do
974 992 date = Date.today
975 993 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :due_date => date)
976 994 assert_equal date, copy.due_date
977 995 end
978 996
979 997 should "set current user as author" do
980 998 User.current = User.find(9)
981 999 copy = @issue.copy(:project_id => 3, :tracker_id => 2)
982 1000 assert_equal User.current, copy.author
983 1001 end
984 1002
985 1003 should "create a journal with notes" do
986 1004 date = Date.today
987 1005 notes = "Notes added when copying"
988 1006 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
989 1007 copy.init_journal(User.current, notes)
990 1008 copy.save!
991 1009
992 1010 assert_equal 1, copy.journals.size
993 1011 journal = copy.journals.first
994 1012 assert_equal 0, journal.details.size
995 1013 assert_equal notes, journal.notes
996 1014 end
997 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 1059 def test_recipients_should_include_previous_assignee
1000 1060 user = User.find(3)
1001 1061 user.members.update_all ["mail_notification = ?", false]
1002 1062 user.update_attribute :mail_notification, 'only_assigned'
1003 1063
1004 1064 issue = Issue.find(2)
1005 1065 issue.assigned_to = nil
1006 1066 assert_include user.mail, issue.recipients
1007 1067 issue.save!
1008 1068 assert !issue.recipients.include?(user.mail)
1009 1069 end
1010 1070
1011 1071 def test_recipients_should_not_include_users_that_cannot_view_the_issue
1012 1072 issue = Issue.find(12)
1013 1073 assert issue.recipients.include?(issue.author.mail)
1014 1074 # copy the issue to a private project
1015 1075 copy = issue.copy(:project_id => 5, :tracker_id => 2)
1016 1076 # author is not a member of project anymore
1017 1077 assert !copy.recipients.include?(copy.author.mail)
1018 1078 end
1019 1079
1020 1080 def test_recipients_should_include_the_assigned_group_members
1021 1081 group_member = User.generate!
1022 1082 group = Group.generate!
1023 1083 group.users << group_member
1024 1084
1025 1085 issue = Issue.find(12)
1026 1086 issue.assigned_to = group
1027 1087 assert issue.recipients.include?(group_member.mail)
1028 1088 end
1029 1089
1030 1090 def test_watcher_recipients_should_not_include_users_that_cannot_view_the_issue
1031 1091 user = User.find(3)
1032 1092 issue = Issue.find(9)
1033 1093 Watcher.create!(:user => user, :watchable => issue)
1034 1094 assert issue.watched_by?(user)
1035 1095 assert !issue.watcher_recipients.include?(user.mail)
1036 1096 end
1037 1097
1038 1098 def test_issue_destroy
1039 1099 Issue.find(1).destroy
1040 1100 assert_nil Issue.find_by_id(1)
1041 1101 assert_nil TimeEntry.find_by_issue_id(1)
1042 1102 end
1043 1103
1044 1104 def test_destroying_a_deleted_issue_should_not_raise_an_error
1045 1105 issue = Issue.find(1)
1046 1106 Issue.find(1).destroy
1047 1107
1048 1108 assert_nothing_raised do
1049 1109 assert_no_difference 'Issue.count' do
1050 1110 issue.destroy
1051 1111 end
1052 1112 assert issue.destroyed?
1053 1113 end
1054 1114 end
1055 1115
1056 1116 def test_destroying_a_stale_issue_should_not_raise_an_error
1057 1117 issue = Issue.find(1)
1058 1118 Issue.find(1).update_attribute :subject, "Updated"
1059 1119
1060 1120 assert_nothing_raised do
1061 1121 assert_difference 'Issue.count', -1 do
1062 1122 issue.destroy
1063 1123 end
1064 1124 assert issue.destroyed?
1065 1125 end
1066 1126 end
1067 1127
1068 1128 def test_blocked
1069 1129 blocked_issue = Issue.find(9)
1070 1130 blocking_issue = Issue.find(10)
1071 1131
1072 1132 assert blocked_issue.blocked?
1073 1133 assert !blocking_issue.blocked?
1074 1134 end
1075 1135
1076 1136 def test_blocked_issues_dont_allow_closed_statuses
1077 1137 blocked_issue = Issue.find(9)
1078 1138
1079 1139 allowed_statuses = blocked_issue.new_statuses_allowed_to(users(:users_002))
1080 1140 assert !allowed_statuses.empty?
1081 1141 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1082 1142 assert closed_statuses.empty?
1083 1143 end
1084 1144
1085 1145 def test_unblocked_issues_allow_closed_statuses
1086 1146 blocking_issue = Issue.find(10)
1087 1147
1088 1148 allowed_statuses = blocking_issue.new_statuses_allowed_to(users(:users_002))
1089 1149 assert !allowed_statuses.empty?
1090 1150 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1091 1151 assert !closed_statuses.empty?
1092 1152 end
1093 1153
1094 1154 def test_rescheduling_an_issue_should_reschedule_following_issue
1095 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 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 1157 IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
1098 1158 assert_equal issue1.due_date + 1, issue2.reload.start_date
1099 1159
1100 1160 issue1.due_date = Date.today + 5
1101 1161 issue1.save!
1102 1162 assert_equal issue1.due_date + 1, issue2.reload.start_date
1103 1163 end
1104 1164
1105 1165 def test_rescheduling_a_stale_issue_should_not_raise_an_error
1106 1166 stale = Issue.find(1)
1107 1167 issue = Issue.find(1)
1108 1168 issue.subject = "Updated"
1109 1169 issue.save!
1110 1170
1111 1171 date = 10.days.from_now.to_date
1112 1172 assert_nothing_raised do
1113 1173 stale.reschedule_after(date)
1114 1174 end
1115 1175 assert_equal date, stale.reload.start_date
1116 1176 end
1117 1177
1118 1178 def test_overdue
1119 1179 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
1120 1180 assert !Issue.new(:due_date => Date.today).overdue?
1121 1181 assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
1122 1182 assert !Issue.new(:due_date => nil).overdue?
1123 1183 assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
1124 1184 end
1125 1185
1126 1186 context "#behind_schedule?" do
1127 1187 should "be false if the issue has no start_date" do
1128 1188 assert !Issue.new(:start_date => nil, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1129 1189 end
1130 1190
1131 1191 should "be false if the issue has no end_date" do
1132 1192 assert !Issue.new(:start_date => 1.day.from_now.to_date, :due_date => nil, :done_ratio => 0).behind_schedule?
1133 1193 end
1134 1194
1135 1195 should "be false if the issue has more done than it's calendar time" do
1136 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 1197 end
1138 1198
1139 1199 should "be true if the issue hasn't been started at all" do
1140 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 1201 end
1142 1202
1143 1203 should "be true if the issue has used more calendar time than it's done ratio" do
1144 1204 assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
1145 1205 end
1146 1206 end
1147 1207
1148 1208 context "#assignable_users" do
1149 1209 should "be Users" do
1150 1210 assert_kind_of User, Issue.find(1).assignable_users.first
1151 1211 end
1152 1212
1153 1213 should "include the issue author" do
1154 1214 project = Project.find(1)
1155 1215 non_project_member = User.generate!
1156 1216 issue = Issue.generate_for_project!(project, :author => non_project_member)
1157 1217
1158 1218 assert issue.assignable_users.include?(non_project_member)
1159 1219 end
1160 1220
1161 1221 should "include the current assignee" do
1162 1222 project = Project.find(1)
1163 1223 user = User.generate!
1164 1224 issue = Issue.generate_for_project!(project, :assigned_to => user)
1165 1225 user.lock!
1166 1226
1167 1227 assert Issue.find(issue.id).assignable_users.include?(user)
1168 1228 end
1169 1229
1170 1230 should "not show the issue author twice" do
1171 1231 assignable_user_ids = Issue.find(1).assignable_users.collect(&:id)
1172 1232 assert_equal 2, assignable_user_ids.length
1173 1233
1174 1234 assignable_user_ids.each do |user_id|
1175 1235 assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once"
1176 1236 end
1177 1237 end
1178 1238
1179 1239 context "with issue_group_assignment" do
1180 1240 should "include groups" do
1181 1241 issue = Issue.new(:project => Project.find(2))
1182 1242
1183 1243 with_settings :issue_group_assignment => '1' do
1184 1244 assert_equal %w(Group User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1185 1245 assert issue.assignable_users.include?(Group.find(11))
1186 1246 end
1187 1247 end
1188 1248 end
1189 1249
1190 1250 context "without issue_group_assignment" do
1191 1251 should "not include groups" do
1192 1252 issue = Issue.new(:project => Project.find(2))
1193 1253
1194 1254 with_settings :issue_group_assignment => '0' do
1195 1255 assert_equal %w(User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1196 1256 assert !issue.assignable_users.include?(Group.find(11))
1197 1257 end
1198 1258 end
1199 1259 end
1200 1260 end
1201 1261
1202 1262 def test_create_should_send_email_notification
1203 1263 ActionMailer::Base.deliveries.clear
1204 1264 issue = Issue.new(:project_id => 1, :tracker_id => 1,
1205 1265 :author_id => 3, :status_id => 1,
1206 1266 :priority => IssuePriority.all.first,
1207 1267 :subject => 'test_create', :estimated_hours => '1:30')
1208 1268
1209 1269 assert issue.save
1210 1270 assert_equal 1, ActionMailer::Base.deliveries.size
1211 1271 end
1212 1272
1213 1273 def test_stale_issue_should_not_send_email_notification
1214 1274 ActionMailer::Base.deliveries.clear
1215 1275 issue = Issue.find(1)
1216 1276 stale = Issue.find(1)
1217 1277
1218 1278 issue.init_journal(User.find(1))
1219 1279 issue.subject = 'Subjet update'
1220 1280 assert issue.save
1221 1281 assert_equal 1, ActionMailer::Base.deliveries.size
1222 1282 ActionMailer::Base.deliveries.clear
1223 1283
1224 1284 stale.init_journal(User.find(1))
1225 1285 stale.subject = 'Another subjet update'
1226 1286 assert_raise ActiveRecord::StaleObjectError do
1227 1287 stale.save
1228 1288 end
1229 1289 assert ActionMailer::Base.deliveries.empty?
1230 1290 end
1231 1291
1232 1292 def test_journalized_description
1233 1293 IssueCustomField.delete_all
1234 1294
1235 1295 i = Issue.first
1236 1296 old_description = i.description
1237 1297 new_description = "This is the new description"
1238 1298
1239 1299 i.init_journal(User.find(2))
1240 1300 i.description = new_description
1241 1301 assert_difference 'Journal.count', 1 do
1242 1302 assert_difference 'JournalDetail.count', 1 do
1243 1303 i.save!
1244 1304 end
1245 1305 end
1246 1306
1247 1307 detail = JournalDetail.first(:order => 'id DESC')
1248 1308 assert_equal i, detail.journal.journalized
1249 1309 assert_equal 'attr', detail.property
1250 1310 assert_equal 'description', detail.prop_key
1251 1311 assert_equal old_description, detail.old_value
1252 1312 assert_equal new_description, detail.value
1253 1313 end
1254 1314
1255 1315 def test_blank_descriptions_should_not_be_journalized
1256 1316 IssueCustomField.delete_all
1257 1317 Issue.update_all("description = NULL", "id=1")
1258 1318
1259 1319 i = Issue.find(1)
1260 1320 i.init_journal(User.find(2))
1261 1321 i.subject = "blank description"
1262 1322 i.description = "\r\n"
1263 1323
1264 1324 assert_difference 'Journal.count', 1 do
1265 1325 assert_difference 'JournalDetail.count', 1 do
1266 1326 i.save!
1267 1327 end
1268 1328 end
1269 1329 end
1270 1330
1271 1331 def test_journalized_multi_custom_field
1272 1332 field = IssueCustomField.create!(:name => 'filter', :field_format => 'list', :is_filter => true, :is_for_all => true,
1273 1333 :tracker_ids => [1], :possible_values => ['value1', 'value2', 'value3'], :multiple => true)
1274 1334
1275 1335 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'Test', :author_id => 1)
1276 1336
1277 1337 assert_difference 'Journal.count' do
1278 1338 assert_difference 'JournalDetail.count' do
1279 1339 issue.init_journal(User.first)
1280 1340 issue.custom_field_values = {field.id => ['value1']}
1281 1341 issue.save!
1282 1342 end
1283 1343 assert_difference 'JournalDetail.count' do
1284 1344 issue.init_journal(User.first)
1285 1345 issue.custom_field_values = {field.id => ['value1', 'value2']}
1286 1346 issue.save!
1287 1347 end
1288 1348 assert_difference 'JournalDetail.count', 2 do
1289 1349 issue.init_journal(User.first)
1290 1350 issue.custom_field_values = {field.id => ['value3', 'value2']}
1291 1351 issue.save!
1292 1352 end
1293 1353 assert_difference 'JournalDetail.count', 2 do
1294 1354 issue.init_journal(User.first)
1295 1355 issue.custom_field_values = {field.id => nil}
1296 1356 issue.save!
1297 1357 end
1298 1358 end
1299 1359 end
1300 1360
1301 1361 def test_description_eol_should_be_normalized
1302 1362 i = Issue.new(:description => "CR \r LF \n CRLF \r\n")
1303 1363 assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description
1304 1364 end
1305 1365
1306 1366 def test_saving_twice_should_not_duplicate_journal_details
1307 1367 i = Issue.find(:first)
1308 1368 i.init_journal(User.find(2), 'Some notes')
1309 1369 # initial changes
1310 1370 i.subject = 'New subject'
1311 1371 i.done_ratio = i.done_ratio + 10
1312 1372 assert_difference 'Journal.count' do
1313 1373 assert i.save
1314 1374 end
1315 1375 # 1 more change
1316 1376 i.priority = IssuePriority.find(:first, :conditions => ["id <> ?", i.priority_id])
1317 1377 assert_no_difference 'Journal.count' do
1318 1378 assert_difference 'JournalDetail.count', 1 do
1319 1379 i.save
1320 1380 end
1321 1381 end
1322 1382 # no more change
1323 1383 assert_no_difference 'Journal.count' do
1324 1384 assert_no_difference 'JournalDetail.count' do
1325 1385 i.save
1326 1386 end
1327 1387 end
1328 1388 end
1329 1389
1330 1390 def test_all_dependent_issues
1331 1391 IssueRelation.delete_all
1332 1392 assert IssueRelation.create!(:issue_from => Issue.find(1),
1333 1393 :issue_to => Issue.find(2),
1334 1394 :relation_type => IssueRelation::TYPE_PRECEDES)
1335 1395 assert IssueRelation.create!(:issue_from => Issue.find(2),
1336 1396 :issue_to => Issue.find(3),
1337 1397 :relation_type => IssueRelation::TYPE_PRECEDES)
1338 1398 assert IssueRelation.create!(:issue_from => Issue.find(3),
1339 1399 :issue_to => Issue.find(8),
1340 1400 :relation_type => IssueRelation::TYPE_PRECEDES)
1341 1401
1342 1402 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1343 1403 end
1344 1404
1345 1405 def test_all_dependent_issues_with_persistent_circular_dependency
1346 1406 IssueRelation.delete_all
1347 1407 assert IssueRelation.create!(:issue_from => Issue.find(1),
1348 1408 :issue_to => Issue.find(2),
1349 1409 :relation_type => IssueRelation::TYPE_PRECEDES)
1350 1410 assert IssueRelation.create!(:issue_from => Issue.find(2),
1351 1411 :issue_to => Issue.find(3),
1352 1412 :relation_type => IssueRelation::TYPE_PRECEDES)
1353 1413
1354 1414 r = IssueRelation.create!(:issue_from => Issue.find(3),
1355 1415 :issue_to => Issue.find(7),
1356 1416 :relation_type => IssueRelation::TYPE_PRECEDES)
1357 1417 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1358 1418
1359 1419 assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
1360 1420 end
1361 1421
1362 1422 def test_all_dependent_issues_with_persistent_multiple_circular_dependencies
1363 1423 IssueRelation.delete_all
1364 1424 assert IssueRelation.create!(:issue_from => Issue.find(1),
1365 1425 :issue_to => Issue.find(2),
1366 1426 :relation_type => IssueRelation::TYPE_RELATES)
1367 1427 assert IssueRelation.create!(:issue_from => Issue.find(2),
1368 1428 :issue_to => Issue.find(3),
1369 1429 :relation_type => IssueRelation::TYPE_RELATES)
1370 1430 assert IssueRelation.create!(:issue_from => Issue.find(3),
1371 1431 :issue_to => Issue.find(8),
1372 1432 :relation_type => IssueRelation::TYPE_RELATES)
1373 1433
1374 1434 r = IssueRelation.create!(:issue_from => Issue.find(8),
1375 1435 :issue_to => Issue.find(7),
1376 1436 :relation_type => IssueRelation::TYPE_RELATES)
1377 1437 IssueRelation.update_all("issue_to_id = 2", ["id = ?", r.id])
1378 1438
1379 1439 r = IssueRelation.create!(:issue_from => Issue.find(3),
1380 1440 :issue_to => Issue.find(7),
1381 1441 :relation_type => IssueRelation::TYPE_RELATES)
1382 1442 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1383 1443
1384 1444 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1385 1445 end
1386 1446
1387 1447 context "#done_ratio" do
1388 1448 setup do
1389 1449 @issue = Issue.find(1)
1390 1450 @issue_status = IssueStatus.find(1)
1391 1451 @issue_status.update_attribute(:default_done_ratio, 50)
1392 1452 @issue2 = Issue.find(2)
1393 1453 @issue_status2 = IssueStatus.find(2)
1394 1454 @issue_status2.update_attribute(:default_done_ratio, 0)
1395 1455 end
1396 1456
1397 1457 teardown do
1398 1458 Setting.issue_done_ratio = 'issue_field'
1399 1459 end
1400 1460
1401 1461 context "with Setting.issue_done_ratio using the issue_field" do
1402 1462 setup do
1403 1463 Setting.issue_done_ratio = 'issue_field'
1404 1464 end
1405 1465
1406 1466 should "read the issue's field" do
1407 1467 assert_equal 0, @issue.done_ratio
1408 1468 assert_equal 30, @issue2.done_ratio
1409 1469 end
1410 1470 end
1411 1471
1412 1472 context "with Setting.issue_done_ratio using the issue_status" do
1413 1473 setup do
1414 1474 Setting.issue_done_ratio = 'issue_status'
1415 1475 end
1416 1476
1417 1477 should "read the Issue Status's default done ratio" do
1418 1478 assert_equal 50, @issue.done_ratio
1419 1479 assert_equal 0, @issue2.done_ratio
1420 1480 end
1421 1481 end
1422 1482 end
1423 1483
1424 1484 context "#update_done_ratio_from_issue_status" do
1425 1485 setup do
1426 1486 @issue = Issue.find(1)
1427 1487 @issue_status = IssueStatus.find(1)
1428 1488 @issue_status.update_attribute(:default_done_ratio, 50)
1429 1489 @issue2 = Issue.find(2)
1430 1490 @issue_status2 = IssueStatus.find(2)
1431 1491 @issue_status2.update_attribute(:default_done_ratio, 0)
1432 1492 end
1433 1493
1434 1494 context "with Setting.issue_done_ratio using the issue_field" do
1435 1495 setup do
1436 1496 Setting.issue_done_ratio = 'issue_field'
1437 1497 end
1438 1498
1439 1499 should "not change the issue" do
1440 1500 @issue.update_done_ratio_from_issue_status
1441 1501 @issue2.update_done_ratio_from_issue_status
1442 1502
1443 1503 assert_equal 0, @issue.read_attribute(:done_ratio)
1444 1504 assert_equal 30, @issue2.read_attribute(:done_ratio)
1445 1505 end
1446 1506 end
1447 1507
1448 1508 context "with Setting.issue_done_ratio using the issue_status" do
1449 1509 setup do
1450 1510 Setting.issue_done_ratio = 'issue_status'
1451 1511 end
1452 1512
1453 1513 should "change the issue's done ratio" do
1454 1514 @issue.update_done_ratio_from_issue_status
1455 1515 @issue2.update_done_ratio_from_issue_status
1456 1516
1457 1517 assert_equal 50, @issue.read_attribute(:done_ratio)
1458 1518 assert_equal 0, @issue2.read_attribute(:done_ratio)
1459 1519 end
1460 1520 end
1461 1521 end
1462 1522
1463 1523 test "#by_tracker" do
1464 1524 User.current = User.anonymous
1465 1525 groups = Issue.by_tracker(Project.find(1))
1466 1526 assert_equal 3, groups.size
1467 1527 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1468 1528 end
1469 1529
1470 1530 test "#by_version" do
1471 1531 User.current = User.anonymous
1472 1532 groups = Issue.by_version(Project.find(1))
1473 1533 assert_equal 3, groups.size
1474 1534 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1475 1535 end
1476 1536
1477 1537 test "#by_priority" do
1478 1538 User.current = User.anonymous
1479 1539 groups = Issue.by_priority(Project.find(1))
1480 1540 assert_equal 4, groups.size
1481 1541 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1482 1542 end
1483 1543
1484 1544 test "#by_category" do
1485 1545 User.current = User.anonymous
1486 1546 groups = Issue.by_category(Project.find(1))
1487 1547 assert_equal 2, groups.size
1488 1548 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1489 1549 end
1490 1550
1491 1551 test "#by_assigned_to" do
1492 1552 User.current = User.anonymous
1493 1553 groups = Issue.by_assigned_to(Project.find(1))
1494 1554 assert_equal 2, groups.size
1495 1555 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1496 1556 end
1497 1557
1498 1558 test "#by_author" do
1499 1559 User.current = User.anonymous
1500 1560 groups = Issue.by_author(Project.find(1))
1501 1561 assert_equal 4, groups.size
1502 1562 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1503 1563 end
1504 1564
1505 1565 test "#by_subproject" do
1506 1566 User.current = User.anonymous
1507 1567 groups = Issue.by_subproject(Project.find(1))
1508 1568 # Private descendant not visible
1509 1569 assert_equal 1, groups.size
1510 1570 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1511 1571 end
1512 1572
1513 1573 def test_recently_updated_scope
1514 1574 #should return the last updated issue
1515 1575 assert_equal Issue.reorder("updated_on DESC").first, Issue.recently_updated.limit(1).first
1516 1576 end
1517 1577
1518 1578 def test_on_active_projects_scope
1519 1579 assert Project.find(2).archive
1520 1580
1521 1581 before = Issue.on_active_project.length
1522 1582 # test inclusion to results
1523 1583 issue = Issue.generate_for_project!(Project.find(1), :tracker => Project.find(2).trackers.first)
1524 1584 assert_equal before + 1, Issue.on_active_project.length
1525 1585
1526 1586 # Move to an archived project
1527 1587 issue.project = Project.find(2)
1528 1588 assert issue.save
1529 1589 assert_equal before, Issue.on_active_project.length
1530 1590 end
1531 1591
1532 1592 context "Issue#recipients" do
1533 1593 setup do
1534 1594 @project = Project.find(1)
1535 1595 @author = User.generate!
1536 1596 @assignee = User.generate!
1537 1597 @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
1538 1598 end
1539 1599
1540 1600 should "include project recipients" do
1541 1601 assert @project.recipients.present?
1542 1602 @project.recipients.each do |project_recipient|
1543 1603 assert @issue.recipients.include?(project_recipient)
1544 1604 end
1545 1605 end
1546 1606
1547 1607 should "include the author if the author is active" do
1548 1608 assert @issue.author, "No author set for Issue"
1549 1609 assert @issue.recipients.include?(@issue.author.mail)
1550 1610 end
1551 1611
1552 1612 should "include the assigned to user if the assigned to user is active" do
1553 1613 assert @issue.assigned_to, "No assigned_to set for Issue"
1554 1614 assert @issue.recipients.include?(@issue.assigned_to.mail)
1555 1615 end
1556 1616
1557 1617 should "not include users who opt out of all email" do
1558 1618 @author.update_attribute(:mail_notification, :none)
1559 1619
1560 1620 assert !@issue.recipients.include?(@issue.author.mail)
1561 1621 end
1562 1622
1563 1623 should "not include the issue author if they are only notified of assigned issues" do
1564 1624 @author.update_attribute(:mail_notification, :only_assigned)
1565 1625
1566 1626 assert !@issue.recipients.include?(@issue.author.mail)
1567 1627 end
1568 1628
1569 1629 should "not include the assigned user if they are only notified of owned issues" do
1570 1630 @assignee.update_attribute(:mail_notification, :only_owner)
1571 1631
1572 1632 assert !@issue.recipients.include?(@issue.assigned_to.mail)
1573 1633 end
1574 1634 end
1575 1635
1576 1636 def test_last_journal_id_with_journals_should_return_the_journal_id
1577 1637 assert_equal 2, Issue.find(1).last_journal_id
1578 1638 end
1579 1639
1580 1640 def test_last_journal_id_without_journals_should_return_nil
1581 1641 assert_nil Issue.find(3).last_journal_id
1582 1642 end
1583 1643
1584 1644 def test_journals_after_should_return_journals_with_greater_id
1585 1645 assert_equal [Journal.find(2)], Issue.find(1).journals_after('1')
1586 1646 assert_equal [], Issue.find(1).journals_after('2')
1587 1647 end
1588 1648
1589 1649 def test_journals_after_with_blank_arg_should_return_all_journals
1590 1650 assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
1591 1651 end
1592 1652 end
General Comments 0
You need to be logged in to leave comments. Login now