##// END OF EJS Templates
Adds a "Copied from/to" relation when copying issue(s) (#6899)....
Jean-Philippe Lang -
r10282:cc4cff9f11b4
parent child
Show More

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

@@ -1,1283 +1,1292
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 :time_entries, :dependent => :delete_all
32 32 has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"
33 33
34 34 has_many :relations_from, :class_name => 'IssueRelation', :foreign_key => 'issue_from_id', :dependent => :delete_all
35 35 has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
36 36
37 37 acts_as_nested_set :scope => 'root_id', :dependent => :destroy
38 38 acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed
39 39 acts_as_customizable
40 40 acts_as_watchable
41 41 acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
42 42 :include => [:project, :journals],
43 43 # sort by id so that limited eager loading doesn't break with postgresql
44 44 :order_column => "#{table_name}.id"
45 45 acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
46 46 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
47 47 :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
48 48
49 49 acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
50 50 :author_key => :author_id
51 51
52 52 DONE_RATIO_OPTIONS = %w(issue_field issue_status)
53 53
54 54 attr_reader :current_journal
55 55
56 56 validates_presence_of :subject, :priority, :project, :tracker, :author, :status
57 57
58 58 validates_length_of :subject, :maximum => 255
59 59 validates_inclusion_of :done_ratio, :in => 0..100
60 60 validates_numericality_of :estimated_hours, :allow_nil => true
61 61 validate :validate_issue, :validate_required_fields
62 62
63 63 scope :visible,
64 64 lambda {|*args| { :include => :project,
65 65 :conditions => Issue.visible_condition(args.shift || User.current, *args) } }
66 66
67 67 scope :open, lambda {|*args|
68 68 is_closed = args.size > 0 ? !args.first : false
69 69 {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
70 70 }
71 71
72 72 scope :recently_updated, :order => "#{Issue.table_name}.updated_on DESC"
73 73 scope :on_active_project, :include => [:status, :project, :tracker],
74 74 :conditions => ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"]
75 75
76 76 before_create :default_assign
77 77 before_save :close_duplicates, :update_done_ratio_from_issue_status, :force_updated_on_change
78 78 after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
79 79 after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
80 80 # Should be after_create but would be called before previous after_save callbacks
81 81 after_save :after_create_from_copy
82 82 after_destroy :update_parent_attributes
83 83
84 84 # Returns a SQL conditions string used to find all issues visible by the specified user
85 85 def self.visible_condition(user, options={})
86 86 Project.allowed_to_condition(user, :view_issues, options) do |role, user|
87 87 if user.logged?
88 88 case role.issues_visibility
89 89 when 'all'
90 90 nil
91 91 when 'default'
92 92 user_ids = [user.id] + user.groups.map(&:id)
93 93 "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
94 94 when 'own'
95 95 user_ids = [user.id] + user.groups.map(&:id)
96 96 "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
97 97 else
98 98 '1=0'
99 99 end
100 100 else
101 101 "(#{table_name}.is_private = #{connection.quoted_false})"
102 102 end
103 103 end
104 104 end
105 105
106 106 # Returns true if usr or current user is allowed to view the issue
107 107 def visible?(usr=nil)
108 108 (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
109 109 if user.logged?
110 110 case role.issues_visibility
111 111 when 'all'
112 112 true
113 113 when 'default'
114 114 !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
115 115 when 'own'
116 116 self.author == user || user.is_or_belongs_to?(assigned_to)
117 117 else
118 118 false
119 119 end
120 120 else
121 121 !self.is_private?
122 122 end
123 123 end
124 124 end
125 125
126 126 def initialize(attributes=nil, *args)
127 127 super
128 128 if new_record?
129 129 # set default values for new records only
130 130 self.status ||= IssueStatus.default
131 131 self.priority ||= IssuePriority.default
132 132 self.watcher_user_ids = []
133 133 end
134 134 end
135 135
136 136 # AR#Persistence#destroy would raise and RecordNotFound exception
137 137 # if the issue was already deleted or updated (non matching lock_version).
138 138 # This is a problem when bulk deleting issues or deleting a project
139 139 # (because an issue may already be deleted if its parent was deleted
140 140 # first).
141 141 # The issue is reloaded by the nested_set before being deleted so
142 142 # the lock_version condition should not be an issue but we handle it.
143 143 def destroy
144 144 super
145 145 rescue ActiveRecord::RecordNotFound
146 146 # Stale or already deleted
147 147 begin
148 148 reload
149 149 rescue ActiveRecord::RecordNotFound
150 150 # The issue was actually already deleted
151 151 @destroyed = true
152 152 return freeze
153 153 end
154 154 # The issue was stale, retry to destroy
155 155 super
156 156 end
157 157
158 158 def reload(*args)
159 159 @workflow_rule_by_attribute = nil
160 160 @assignable_versions = nil
161 161 super
162 162 end
163 163
164 164 # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
165 165 def available_custom_fields
166 166 (project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
167 167 end
168 168
169 169 # Copies attributes from another issue, arg can be an id or an Issue
170 170 def copy_from(arg, options={})
171 171 issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
172 172 self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
173 173 self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
174 174 self.status = issue.status
175 175 self.author = User.current
176 176 unless options[:attachments] == false
177 177 self.attachments = issue.attachments.map do |attachement|
178 178 attachement.copy(:container => self)
179 179 end
180 180 end
181 181 @copied_from = issue
182 182 @copy_options = options
183 183 self
184 184 end
185 185
186 186 # Returns an unsaved copy of the issue
187 187 def copy(attributes=nil, copy_options={})
188 188 copy = self.class.new.copy_from(self, copy_options)
189 189 copy.attributes = attributes if attributes
190 190 copy
191 191 end
192 192
193 193 # Returns true if the issue is a copy
194 194 def copy?
195 195 @copied_from.present?
196 196 end
197 197
198 198 # Moves/copies an issue to a new project and tracker
199 199 # Returns the moved/copied issue on success, false on failure
200 200 def move_to_project(new_project, new_tracker=nil, options={})
201 201 ActiveSupport::Deprecation.warn "Issue#move_to_project is deprecated, use #project= instead."
202 202
203 203 if options[:copy]
204 204 issue = self.copy
205 205 else
206 206 issue = self
207 207 end
208 208
209 209 issue.init_journal(User.current, options[:notes])
210 210
211 211 # Preserve previous behaviour
212 212 # #move_to_project doesn't change tracker automatically
213 213 issue.send :project=, new_project, true
214 214 if new_tracker
215 215 issue.tracker = new_tracker
216 216 end
217 217 # Allow bulk setting of attributes on the issue
218 218 if options[:attributes]
219 219 issue.attributes = options[:attributes]
220 220 end
221 221
222 222 issue.save ? issue : false
223 223 end
224 224
225 225 def status_id=(sid)
226 226 self.status = nil
227 227 result = write_attribute(:status_id, sid)
228 228 @workflow_rule_by_attribute = nil
229 229 result
230 230 end
231 231
232 232 def priority_id=(pid)
233 233 self.priority = nil
234 234 write_attribute(:priority_id, pid)
235 235 end
236 236
237 237 def category_id=(cid)
238 238 self.category = nil
239 239 write_attribute(:category_id, cid)
240 240 end
241 241
242 242 def fixed_version_id=(vid)
243 243 self.fixed_version = nil
244 244 write_attribute(:fixed_version_id, vid)
245 245 end
246 246
247 247 def tracker_id=(tid)
248 248 self.tracker = nil
249 249 result = write_attribute(:tracker_id, tid)
250 250 @custom_field_values = nil
251 251 @workflow_rule_by_attribute = nil
252 252 result
253 253 end
254 254
255 255 def project_id=(project_id)
256 256 if project_id.to_s != self.project_id.to_s
257 257 self.project = (project_id.present? ? Project.find_by_id(project_id) : nil)
258 258 end
259 259 end
260 260
261 261 def project=(project, keep_tracker=false)
262 262 project_was = self.project
263 263 write_attribute(:project_id, project ? project.id : nil)
264 264 association_instance_set('project', project)
265 265 if project_was && project && project_was != project
266 266 @assignable_versions = nil
267 267
268 268 unless keep_tracker || project.trackers.include?(tracker)
269 269 self.tracker = project.trackers.first
270 270 end
271 271 # Reassign to the category with same name if any
272 272 if category
273 273 self.category = project.issue_categories.find_by_name(category.name)
274 274 end
275 275 # Keep the fixed_version if it's still valid in the new_project
276 276 if fixed_version && fixed_version.project != project && !project.shared_versions.include?(fixed_version)
277 277 self.fixed_version = nil
278 278 end
279 279 if parent && parent.project_id != project_id
280 280 self.parent_issue_id = nil
281 281 end
282 282 @custom_field_values = nil
283 283 end
284 284 end
285 285
286 286 def description=(arg)
287 287 if arg.is_a?(String)
288 288 arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
289 289 end
290 290 write_attribute(:description, arg)
291 291 end
292 292
293 293 # Overrides assign_attributes so that project and tracker get assigned first
294 294 def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
295 295 return if new_attributes.nil?
296 296 attrs = new_attributes.dup
297 297 attrs.stringify_keys!
298 298
299 299 %w(project project_id tracker tracker_id).each do |attr|
300 300 if attrs.has_key?(attr)
301 301 send "#{attr}=", attrs.delete(attr)
302 302 end
303 303 end
304 304 send :assign_attributes_without_project_and_tracker_first, attrs, *args
305 305 end
306 306 # Do not redefine alias chain on reload (see #4838)
307 307 alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
308 308
309 309 def estimated_hours=(h)
310 310 write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
311 311 end
312 312
313 313 safe_attributes 'project_id',
314 314 :if => lambda {|issue, user|
315 315 if issue.new_record?
316 316 issue.copy?
317 317 elsif user.allowed_to?(:move_issues, issue.project)
318 318 projects = Issue.allowed_target_projects_on_move(user)
319 319 projects.include?(issue.project) && projects.size > 1
320 320 end
321 321 }
322 322
323 323 safe_attributes 'tracker_id',
324 324 'status_id',
325 325 'category_id',
326 326 'assigned_to_id',
327 327 'priority_id',
328 328 'fixed_version_id',
329 329 'subject',
330 330 'description',
331 331 'start_date',
332 332 'due_date',
333 333 'done_ratio',
334 334 'estimated_hours',
335 335 'custom_field_values',
336 336 'custom_fields',
337 337 'lock_version',
338 338 :if => lambda {|issue, user| issue.new_record? || user.allowed_to?(:edit_issues, issue.project) }
339 339
340 340 safe_attributes 'status_id',
341 341 'assigned_to_id',
342 342 'fixed_version_id',
343 343 'done_ratio',
344 344 'lock_version',
345 345 :if => lambda {|issue, user| issue.new_statuses_allowed_to(user).any? }
346 346
347 347 safe_attributes 'watcher_user_ids',
348 348 :if => lambda {|issue, user| issue.new_record? && user.allowed_to?(:add_issue_watchers, issue.project)}
349 349
350 350 safe_attributes 'is_private',
351 351 :if => lambda {|issue, user|
352 352 user.allowed_to?(:set_issues_private, issue.project) ||
353 353 (issue.author == user && user.allowed_to?(:set_own_issues_private, issue.project))
354 354 }
355 355
356 356 safe_attributes 'parent_issue_id',
357 357 :if => lambda {|issue, user| (issue.new_record? || user.allowed_to?(:edit_issues, issue.project)) &&
358 358 user.allowed_to?(:manage_subtasks, issue.project)}
359 359
360 360 def safe_attribute_names(user=nil)
361 361 names = super
362 362 names -= disabled_core_fields
363 363 names -= read_only_attribute_names(user)
364 364 names
365 365 end
366 366
367 367 # Safely sets attributes
368 368 # Should be called from controllers instead of #attributes=
369 369 # attr_accessible is too rough because we still want things like
370 370 # Issue.new(:project => foo) to work
371 371 def safe_attributes=(attrs, user=User.current)
372 372 return unless attrs.is_a?(Hash)
373 373
374 374 attrs = attrs.dup
375 375
376 376 # Project and Tracker must be set before since new_statuses_allowed_to depends on it.
377 377 if (p = attrs.delete('project_id')) && safe_attribute?('project_id')
378 378 if allowed_target_projects(user).collect(&:id).include?(p.to_i)
379 379 self.project_id = p
380 380 end
381 381 end
382 382
383 383 if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
384 384 self.tracker_id = t
385 385 end
386 386
387 387 if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
388 388 if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)
389 389 self.status_id = s
390 390 end
391 391 end
392 392
393 393 attrs = delete_unsafe_attributes(attrs, user)
394 394 return if attrs.empty?
395 395
396 396 unless leaf?
397 397 attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
398 398 end
399 399
400 400 if attrs['parent_issue_id'].present?
401 401 attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i)
402 402 end
403 403
404 404 if attrs['custom_field_values'].present?
405 405 attrs['custom_field_values'] = attrs['custom_field_values'].reject {|k, v| read_only_attribute_names(user).include? k.to_s}
406 406 end
407 407
408 408 if attrs['custom_fields'].present?
409 409 attrs['custom_fields'] = attrs['custom_fields'].reject {|c| read_only_attribute_names(user).include? c['id'].to_s}
410 410 end
411 411
412 412 # mass-assignment security bypass
413 413 assign_attributes attrs, :without_protection => true
414 414 end
415 415
416 416 def disabled_core_fields
417 417 tracker ? tracker.disabled_core_fields : []
418 418 end
419 419
420 420 # Returns the custom_field_values that can be edited by the given user
421 421 def editable_custom_field_values(user=nil)
422 422 custom_field_values.reject do |value|
423 423 read_only_attribute_names(user).include?(value.custom_field_id.to_s)
424 424 end
425 425 end
426 426
427 427 # Returns the names of attributes that are read-only for user or the current user
428 428 # For users with multiple roles, the read-only fields are the intersection of
429 429 # read-only fields of each role
430 430 # The result is an array of strings where sustom fields are represented with their ids
431 431 #
432 432 # Examples:
433 433 # issue.read_only_attribute_names # => ['due_date', '2']
434 434 # issue.read_only_attribute_names(user) # => []
435 435 def read_only_attribute_names(user=nil)
436 436 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
437 437 end
438 438
439 439 # Returns the names of required attributes for user or the current user
440 440 # For users with multiple roles, the required fields are the intersection of
441 441 # required fields of each role
442 442 # The result is an array of strings where sustom fields are represented with their ids
443 443 #
444 444 # Examples:
445 445 # issue.required_attribute_names # => ['due_date', '2']
446 446 # issue.required_attribute_names(user) # => []
447 447 def required_attribute_names(user=nil)
448 448 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
449 449 end
450 450
451 451 # Returns true if the attribute is required for user
452 452 def required_attribute?(name, user=nil)
453 453 required_attribute_names(user).include?(name.to_s)
454 454 end
455 455
456 456 # Returns a hash of the workflow rule by attribute for the given user
457 457 #
458 458 # Examples:
459 459 # issue.workflow_rule_by_attribute # => {'due_date' => 'required', 'start_date' => 'readonly'}
460 460 def workflow_rule_by_attribute(user=nil)
461 461 return @workflow_rule_by_attribute if @workflow_rule_by_attribute && user.nil?
462 462
463 463 user_real = user || User.current
464 464 roles = user_real.admin ? Role.all : user_real.roles_for_project(project)
465 465 return {} if roles.empty?
466 466
467 467 result = {}
468 468 workflow_permissions = WorkflowPermission.where(:tracker_id => tracker_id, :old_status_id => status_id, :role_id => roles.map(&:id)).all
469 469 if workflow_permissions.any?
470 470 workflow_rules = workflow_permissions.inject({}) do |h, wp|
471 471 h[wp.field_name] ||= []
472 472 h[wp.field_name] << wp.rule
473 473 h
474 474 end
475 475 workflow_rules.each do |attr, rules|
476 476 next if rules.size < roles.size
477 477 uniq_rules = rules.uniq
478 478 if uniq_rules.size == 1
479 479 result[attr] = uniq_rules.first
480 480 else
481 481 result[attr] = 'required'
482 482 end
483 483 end
484 484 end
485 485 @workflow_rule_by_attribute = result if user.nil?
486 486 result
487 487 end
488 488 private :workflow_rule_by_attribute
489 489
490 490 def done_ratio
491 491 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
492 492 status.default_done_ratio
493 493 else
494 494 read_attribute(:done_ratio)
495 495 end
496 496 end
497 497
498 498 def self.use_status_for_done_ratio?
499 499 Setting.issue_done_ratio == 'issue_status'
500 500 end
501 501
502 502 def self.use_field_for_done_ratio?
503 503 Setting.issue_done_ratio == 'issue_field'
504 504 end
505 505
506 506 def validate_issue
507 507 if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
508 508 errors.add :due_date, :not_a_date
509 509 end
510 510
511 511 if self.due_date and self.start_date and self.due_date < self.start_date
512 512 errors.add :due_date, :greater_than_start_date
513 513 end
514 514
515 515 if start_date && soonest_start && start_date < soonest_start
516 516 errors.add :start_date, :invalid
517 517 end
518 518
519 519 if fixed_version
520 520 if !assignable_versions.include?(fixed_version)
521 521 errors.add :fixed_version_id, :inclusion
522 522 elsif reopened? && fixed_version.closed?
523 523 errors.add :base, I18n.t(:error_can_not_reopen_issue_on_closed_version)
524 524 end
525 525 end
526 526
527 527 # Checks that the issue can not be added/moved to a disabled tracker
528 528 if project && (tracker_id_changed? || project_id_changed?)
529 529 unless project.trackers.include?(tracker)
530 530 errors.add :tracker_id, :inclusion
531 531 end
532 532 end
533 533
534 534 # Checks parent issue assignment
535 535 if @parent_issue
536 536 if @parent_issue.project_id != project_id
537 537 errors.add :parent_issue_id, :not_same_project
538 538 elsif !new_record?
539 539 # moving an existing issue
540 540 if @parent_issue.root_id != root_id
541 541 # we can always move to another tree
542 542 elsif move_possible?(@parent_issue)
543 543 # move accepted inside tree
544 544 else
545 545 errors.add :parent_issue_id, :not_a_valid_parent
546 546 end
547 547 end
548 548 end
549 549 end
550 550
551 551 # Validates the issue against additional workflow requirements
552 552 def validate_required_fields
553 553 user = new_record? ? author : current_journal.try(:user)
554 554
555 555 required_attribute_names(user).each do |attribute|
556 556 if attribute =~ /^\d+$/
557 557 attribute = attribute.to_i
558 558 v = custom_field_values.detect {|v| v.custom_field_id == attribute }
559 559 if v && v.value.blank?
560 560 errors.add :base, v.custom_field.name + ' ' + l('activerecord.errors.messages.blank')
561 561 end
562 562 else
563 563 if respond_to?(attribute) && send(attribute).blank?
564 564 errors.add attribute, :blank
565 565 end
566 566 end
567 567 end
568 568 end
569 569
570 570 # Set the done_ratio using the status if that setting is set. This will keep the done_ratios
571 571 # even if the user turns off the setting later
572 572 def update_done_ratio_from_issue_status
573 573 if Issue.use_status_for_done_ratio? && status && status.default_done_ratio
574 574 self.done_ratio = status.default_done_ratio
575 575 end
576 576 end
577 577
578 578 def init_journal(user, notes = "")
579 579 @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
580 580 if new_record?
581 581 @current_journal.notify = false
582 582 else
583 583 @attributes_before_change = attributes.dup
584 584 @custom_values_before_change = {}
585 585 self.custom_field_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value }
586 586 end
587 587 @current_journal
588 588 end
589 589
590 590 # Returns the id of the last journal or nil
591 591 def last_journal_id
592 592 if new_record?
593 593 nil
594 594 else
595 595 journals.maximum(:id)
596 596 end
597 597 end
598 598
599 599 # Returns a scope for journals that have an id greater than journal_id
600 600 def journals_after(journal_id)
601 601 scope = journals.reorder("#{Journal.table_name}.id ASC")
602 602 if journal_id.present?
603 603 scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
604 604 end
605 605 scope
606 606 end
607 607
608 608 # Return true if the issue is closed, otherwise false
609 609 def closed?
610 610 self.status.is_closed?
611 611 end
612 612
613 613 # Return true if the issue is being reopened
614 614 def reopened?
615 615 if !new_record? && status_id_changed?
616 616 status_was = IssueStatus.find_by_id(status_id_was)
617 617 status_new = IssueStatus.find_by_id(status_id)
618 618 if status_was && status_new && status_was.is_closed? && !status_new.is_closed?
619 619 return true
620 620 end
621 621 end
622 622 false
623 623 end
624 624
625 625 # Return true if the issue is being closed
626 626 def closing?
627 627 if !new_record? && status_id_changed?
628 628 status_was = IssueStatus.find_by_id(status_id_was)
629 629 status_new = IssueStatus.find_by_id(status_id)
630 630 if status_was && status_new && !status_was.is_closed? && status_new.is_closed?
631 631 return true
632 632 end
633 633 end
634 634 false
635 635 end
636 636
637 637 # Returns true if the issue is overdue
638 638 def overdue?
639 639 !due_date.nil? && (due_date < Date.today) && !status.is_closed?
640 640 end
641 641
642 642 # Is the amount of work done less than it should for the due date
643 643 def behind_schedule?
644 644 return false if start_date.nil? || due_date.nil?
645 645 done_date = start_date + ((due_date - start_date+1)* done_ratio/100).floor
646 646 return done_date <= Date.today
647 647 end
648 648
649 649 # Does this issue have children?
650 650 def children?
651 651 !leaf?
652 652 end
653 653
654 654 # Users the issue can be assigned to
655 655 def assignable_users
656 656 users = project.assignable_users
657 657 users << author if author
658 658 users << assigned_to if assigned_to
659 659 users.uniq.sort
660 660 end
661 661
662 662 # Versions that the issue can be assigned to
663 663 def assignable_versions
664 664 return @assignable_versions if @assignable_versions
665 665
666 666 versions = project.shared_versions.open.all
667 667 if fixed_version
668 668 if fixed_version_id_changed?
669 669 # nothing to do
670 670 elsif project_id_changed?
671 671 if project.shared_versions.include?(fixed_version)
672 672 versions << fixed_version
673 673 end
674 674 else
675 675 versions << fixed_version
676 676 end
677 677 end
678 678 @assignable_versions = versions.uniq.sort
679 679 end
680 680
681 681 # Returns true if this issue is blocked by another issue that is still open
682 682 def blocked?
683 683 !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil?
684 684 end
685 685
686 686 # Returns an array of statuses that user is able to apply
687 687 def new_statuses_allowed_to(user=User.current, include_default=false)
688 688 if new_record? && @copied_from
689 689 [IssueStatus.default, @copied_from.status].compact.uniq.sort
690 690 else
691 691 initial_status = nil
692 692 if new_record?
693 693 initial_status = IssueStatus.default
694 694 elsif status_id_was
695 695 initial_status = IssueStatus.find_by_id(status_id_was)
696 696 end
697 697 initial_status ||= status
698 698
699 699 statuses = initial_status.find_new_statuses_allowed_to(
700 700 user.admin ? Role.all : user.roles_for_project(project),
701 701 tracker,
702 702 author == user,
703 703 assigned_to_id_changed? ? assigned_to_id_was == user.id : assigned_to_id == user.id
704 704 )
705 705 statuses << initial_status unless statuses.empty?
706 706 statuses << IssueStatus.default if include_default
707 707 statuses = statuses.compact.uniq.sort
708 708 blocked? ? statuses.reject {|s| s.is_closed?} : statuses
709 709 end
710 710 end
711 711
712 712 def assigned_to_was
713 713 if assigned_to_id_changed? && assigned_to_id_was.present?
714 714 @assigned_to_was ||= User.find_by_id(assigned_to_id_was)
715 715 end
716 716 end
717 717
718 718 # Returns the mail adresses of users that should be notified
719 719 def recipients
720 720 notified = []
721 721 # Author and assignee are always notified unless they have been
722 722 # locked or don't want to be notified
723 723 notified << author if author
724 724 if assigned_to
725 725 notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
726 726 end
727 727 if assigned_to_was
728 728 notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
729 729 end
730 730 notified = notified.select {|u| u.active? && u.notify_about?(self)}
731 731
732 732 notified += project.notified_users
733 733 notified.uniq!
734 734 # Remove users that can not view the issue
735 735 notified.reject! {|user| !visible?(user)}
736 736 notified.collect(&:mail)
737 737 end
738 738
739 739 # Returns the number of hours spent on this issue
740 740 def spent_hours
741 741 @spent_hours ||= time_entries.sum(:hours) || 0
742 742 end
743 743
744 744 # Returns the total number of hours spent on this issue and its descendants
745 745 #
746 746 # Example:
747 747 # spent_hours => 0.0
748 748 # spent_hours => 50.2
749 749 def total_spent_hours
750 750 @total_spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours",
751 751 :joins => "LEFT JOIN #{TimeEntry.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id").to_f || 0.0
752 752 end
753 753
754 754 def relations
755 755 @relations ||= (relations_from + relations_to).sort
756 756 end
757 757
758 758 # Preloads relations for a collection of issues
759 759 def self.load_relations(issues)
760 760 if issues.any?
761 761 relations = IssueRelation.all(:conditions => ["issue_from_id IN (:ids) OR issue_to_id IN (:ids)", {:ids => issues.map(&:id)}])
762 762 issues.each do |issue|
763 763 issue.instance_variable_set "@relations", relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id}
764 764 end
765 765 end
766 766 end
767 767
768 768 # Preloads visible spent time for a collection of issues
769 769 def self.load_visible_spent_hours(issues, user=User.current)
770 770 if issues.any?
771 771 hours_by_issue_id = TimeEntry.visible(user).sum(:hours, :group => :issue_id)
772 772 issues.each do |issue|
773 773 issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0)
774 774 end
775 775 end
776 776 end
777 777
778 778 # Finds an issue relation given its id.
779 779 def find_relation(relation_id)
780 780 IssueRelation.find(relation_id, :conditions => ["issue_to_id = ? OR issue_from_id = ?", id, id])
781 781 end
782 782
783 783 def all_dependent_issues(except=[])
784 784 except << self
785 785 dependencies = []
786 786 relations_from.each do |relation|
787 787 if relation.issue_to && !except.include?(relation.issue_to)
788 788 dependencies << relation.issue_to
789 789 dependencies += relation.issue_to.all_dependent_issues(except)
790 790 end
791 791 end
792 792 dependencies
793 793 end
794 794
795 795 # Returns an array of issues that duplicate this one
796 796 def duplicates
797 797 relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
798 798 end
799 799
800 800 # Returns the due date or the target due date if any
801 801 # Used on gantt chart
802 802 def due_before
803 803 due_date || (fixed_version ? fixed_version.effective_date : nil)
804 804 end
805 805
806 806 # Returns the time scheduled for this issue.
807 807 #
808 808 # Example:
809 809 # Start Date: 2/26/09, End Date: 3/04/09
810 810 # duration => 6
811 811 def duration
812 812 (start_date && due_date) ? due_date - start_date : 0
813 813 end
814 814
815 815 def soonest_start
816 816 @soonest_start ||= (
817 817 relations_to.collect{|relation| relation.successor_soonest_start} +
818 818 ancestors.collect(&:soonest_start)
819 819 ).compact.max
820 820 end
821 821
822 822 def reschedule_after(date)
823 823 return if date.nil?
824 824 if leaf?
825 825 if start_date.nil? || start_date < date
826 826 self.start_date, self.due_date = date, date + duration
827 827 begin
828 828 save
829 829 rescue ActiveRecord::StaleObjectError
830 830 reload
831 831 self.start_date, self.due_date = date, date + duration
832 832 save
833 833 end
834 834 end
835 835 else
836 836 leaves.each do |leaf|
837 837 leaf.reschedule_after(date)
838 838 end
839 839 end
840 840 end
841 841
842 842 def <=>(issue)
843 843 if issue.nil?
844 844 -1
845 845 elsif root_id != issue.root_id
846 846 (root_id || 0) <=> (issue.root_id || 0)
847 847 else
848 848 (lft || 0) <=> (issue.lft || 0)
849 849 end
850 850 end
851 851
852 852 def to_s
853 853 "#{tracker} ##{id}: #{subject}"
854 854 end
855 855
856 856 # Returns a string of css classes that apply to the issue
857 857 def css_classes
858 858 s = "issue status-#{status_id} priority-#{priority_id}"
859 859 s << ' closed' if closed?
860 860 s << ' overdue' if overdue?
861 861 s << ' child' if child?
862 862 s << ' parent' unless leaf?
863 863 s << ' private' if is_private?
864 864 s << ' created-by-me' if User.current.logged? && author_id == User.current.id
865 865 s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id
866 866 s
867 867 end
868 868
869 869 # Saves an issue and a time_entry from the parameters
870 870 def save_issue_with_child_records(params, existing_time_entry=nil)
871 871 Issue.transaction do
872 872 if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, project)
873 873 @time_entry = existing_time_entry || TimeEntry.new
874 874 @time_entry.project = project
875 875 @time_entry.issue = self
876 876 @time_entry.user = User.current
877 877 @time_entry.spent_on = User.current.today
878 878 @time_entry.attributes = params[:time_entry]
879 879 self.time_entries << @time_entry
880 880 end
881 881
882 882 # TODO: Rename hook
883 883 Redmine::Hook.call_hook(:controller_issues_edit_before_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
884 884 if save
885 885 # TODO: Rename hook
886 886 Redmine::Hook.call_hook(:controller_issues_edit_after_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})
887 887 else
888 888 raise ActiveRecord::Rollback
889 889 end
890 890 end
891 891 end
892 892
893 893 # Unassigns issues from +version+ if it's no longer shared with issue's project
894 894 def self.update_versions_from_sharing_change(version)
895 895 # Update issues assigned to the version
896 896 update_versions(["#{Issue.table_name}.fixed_version_id = ?", version.id])
897 897 end
898 898
899 899 # Unassigns issues from versions that are no longer shared
900 900 # after +project+ was moved
901 901 def self.update_versions_from_hierarchy_change(project)
902 902 moved_project_ids = project.self_and_descendants.reload.collect(&:id)
903 903 # Update issues of the moved projects and issues assigned to a version of a moved project
904 904 Issue.update_versions(["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)", moved_project_ids, moved_project_ids])
905 905 end
906 906
907 907 def parent_issue_id=(arg)
908 908 parent_issue_id = arg.blank? ? nil : arg.to_i
909 909 if parent_issue_id && @parent_issue = Issue.find_by_id(parent_issue_id)
910 910 @parent_issue.id
911 911 else
912 912 @parent_issue = nil
913 913 nil
914 914 end
915 915 end
916 916
917 917 def parent_issue_id
918 918 if instance_variable_defined? :@parent_issue
919 919 @parent_issue.nil? ? nil : @parent_issue.id
920 920 else
921 921 parent_id
922 922 end
923 923 end
924 924
925 925 # Extracted from the ReportsController.
926 926 def self.by_tracker(project)
927 927 count_and_group_by(:project => project,
928 928 :field => 'tracker_id',
929 929 :joins => Tracker.table_name)
930 930 end
931 931
932 932 def self.by_version(project)
933 933 count_and_group_by(:project => project,
934 934 :field => 'fixed_version_id',
935 935 :joins => Version.table_name)
936 936 end
937 937
938 938 def self.by_priority(project)
939 939 count_and_group_by(:project => project,
940 940 :field => 'priority_id',
941 941 :joins => IssuePriority.table_name)
942 942 end
943 943
944 944 def self.by_category(project)
945 945 count_and_group_by(:project => project,
946 946 :field => 'category_id',
947 947 :joins => IssueCategory.table_name)
948 948 end
949 949
950 950 def self.by_assigned_to(project)
951 951 count_and_group_by(:project => project,
952 952 :field => 'assigned_to_id',
953 953 :joins => User.table_name)
954 954 end
955 955
956 956 def self.by_author(project)
957 957 count_and_group_by(:project => project,
958 958 :field => 'author_id',
959 959 :joins => User.table_name)
960 960 end
961 961
962 962 def self.by_subproject(project)
963 963 ActiveRecord::Base.connection.select_all("select s.id as status_id,
964 964 s.is_closed as closed,
965 965 #{Issue.table_name}.project_id as project_id,
966 966 count(#{Issue.table_name}.id) as total
967 967 from
968 968 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s
969 969 where
970 970 #{Issue.table_name}.status_id=s.id
971 971 and #{Issue.table_name}.project_id = #{Project.table_name}.id
972 972 and #{visible_condition(User.current, :project => project, :with_subprojects => true)}
973 973 and #{Issue.table_name}.project_id <> #{project.id}
974 974 group by s.id, s.is_closed, #{Issue.table_name}.project_id") if project.descendants.active.any?
975 975 end
976 976 # End ReportsController extraction
977 977
978 978 # Returns an array of projects that user can assign the issue to
979 979 def allowed_target_projects(user=User.current)
980 980 if new_record?
981 981 Project.all(:conditions => Project.allowed_to_condition(user, :add_issues))
982 982 else
983 983 self.class.allowed_target_projects_on_move(user)
984 984 end
985 985 end
986 986
987 987 # Returns an array of projects that user can move issues to
988 988 def self.allowed_target_projects_on_move(user=User.current)
989 989 Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
990 990 end
991 991
992 992 private
993 993
994 994 def after_project_change
995 995 # Update project_id on related time entries
996 996 TimeEntry.update_all(["project_id = ?", project_id], {:issue_id => id})
997 997
998 998 # Delete issue relations
999 999 unless Setting.cross_project_issue_relations?
1000 1000 relations_from.clear
1001 1001 relations_to.clear
1002 1002 end
1003 1003
1004 1004 # Move subtasks
1005 1005 children.each do |child|
1006 1006 # Change project and keep project
1007 1007 child.send :project=, project, true
1008 1008 unless child.save
1009 1009 raise ActiveRecord::Rollback
1010 1010 end
1011 1011 end
1012 1012 end
1013 1013
1014 # Copies subtasks from the copied issue
1014 # Callback for after the creation of an issue by copy
1015 # * adds a "copied to" relation with the copied issue
1016 # * copies subtasks from the copied issue
1015 1017 def after_create_from_copy
1016 return unless copy?
1018 return unless copy? && !@after_create_from_copy_handled
1017 1019
1018 unless @copied_from.leaf? || @copy_options[:subtasks] == false || @subtasks_copied
1020 if @copied_from.project_id == project_id || Setting.cross_project_issue_relations?
1021 relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
1022 unless relation.save
1023 logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
1024 end
1025 end
1026
1027 unless @copied_from.leaf? || @copy_options[:subtasks] == false
1019 1028 @copied_from.children.each do |child|
1020 1029 unless child.visible?
1021 1030 # Do not copy subtasks that are not visible to avoid potential disclosure of private data
1022 1031 logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
1023 1032 next
1024 1033 end
1025 1034 copy = Issue.new.copy_from(child, @copy_options)
1026 1035 copy.author = author
1027 1036 copy.project = project
1028 1037 copy.parent_issue_id = id
1029 1038 # Children subtasks are copied recursively
1030 1039 unless copy.save
1031 1040 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
1032 1041 end
1033 1042 end
1034 @subtasks_copied = true
1035 1043 end
1044 @after_create_from_copy_handled = true
1036 1045 end
1037 1046
1038 1047 def update_nested_set_attributes
1039 1048 if root_id.nil?
1040 1049 # issue was just created
1041 1050 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
1042 1051 set_default_left_and_right
1043 1052 Issue.update_all("root_id = #{root_id}, lft = #{lft}, rgt = #{rgt}", ["id = ?", id])
1044 1053 if @parent_issue
1045 1054 move_to_child_of(@parent_issue)
1046 1055 end
1047 1056 reload
1048 1057 elsif parent_issue_id != parent_id
1049 1058 former_parent_id = parent_id
1050 1059 # moving an existing issue
1051 1060 if @parent_issue && @parent_issue.root_id == root_id
1052 1061 # inside the same tree
1053 1062 move_to_child_of(@parent_issue)
1054 1063 else
1055 1064 # to another tree
1056 1065 unless root?
1057 1066 move_to_right_of(root)
1058 1067 reload
1059 1068 end
1060 1069 old_root_id = root_id
1061 1070 self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
1062 1071 target_maxright = nested_set_scope.maximum(right_column_name) || 0
1063 1072 offset = target_maxright + 1 - lft
1064 1073 Issue.update_all("root_id = #{root_id}, lft = lft + #{offset}, rgt = rgt + #{offset}",
1065 1074 ["root_id = ? AND lft >= ? AND rgt <= ? ", old_root_id, lft, rgt])
1066 1075 self[left_column_name] = lft + offset
1067 1076 self[right_column_name] = rgt + offset
1068 1077 if @parent_issue
1069 1078 move_to_child_of(@parent_issue)
1070 1079 end
1071 1080 end
1072 1081 reload
1073 1082 # delete invalid relations of all descendants
1074 1083 self_and_descendants.each do |issue|
1075 1084 issue.relations.each do |relation|
1076 1085 relation.destroy unless relation.valid?
1077 1086 end
1078 1087 end
1079 1088 # update former parent
1080 1089 recalculate_attributes_for(former_parent_id) if former_parent_id
1081 1090 end
1082 1091 remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
1083 1092 end
1084 1093
1085 1094 def update_parent_attributes
1086 1095 recalculate_attributes_for(parent_id) if parent_id
1087 1096 end
1088 1097
1089 1098 def recalculate_attributes_for(issue_id)
1090 1099 if issue_id && p = Issue.find_by_id(issue_id)
1091 1100 # priority = highest priority of children
1092 1101 if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :joins => :priority)
1093 1102 p.priority = IssuePriority.find_by_position(priority_position)
1094 1103 end
1095 1104
1096 1105 # start/due dates = lowest/highest dates of children
1097 1106 p.start_date = p.children.minimum(:start_date)
1098 1107 p.due_date = p.children.maximum(:due_date)
1099 1108 if p.start_date && p.due_date && p.due_date < p.start_date
1100 1109 p.start_date, p.due_date = p.due_date, p.start_date
1101 1110 end
1102 1111
1103 1112 # done ratio = weighted average ratio of leaves
1104 1113 unless Issue.use_status_for_done_ratio? && p.status && p.status.default_done_ratio
1105 1114 leaves_count = p.leaves.count
1106 1115 if leaves_count > 0
1107 1116 average = p.leaves.average(:estimated_hours).to_f
1108 1117 if average == 0
1109 1118 average = 1
1110 1119 end
1111 1120 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
1112 1121 progress = done / (average * leaves_count)
1113 1122 p.done_ratio = progress.round
1114 1123 end
1115 1124 end
1116 1125
1117 1126 # estimate = sum of leaves estimates
1118 1127 p.estimated_hours = p.leaves.sum(:estimated_hours).to_f
1119 1128 p.estimated_hours = nil if p.estimated_hours == 0.0
1120 1129
1121 1130 # ancestors will be recursively updated
1122 1131 p.save(:validate => false)
1123 1132 end
1124 1133 end
1125 1134
1126 1135 # Update issues so their versions are not pointing to a
1127 1136 # fixed_version that is not shared with the issue's project
1128 1137 def self.update_versions(conditions=nil)
1129 1138 # Only need to update issues with a fixed_version from
1130 1139 # a different project and that is not systemwide shared
1131 1140 Issue.scoped(:conditions => conditions).all(
1132 1141 :conditions => "#{Issue.table_name}.fixed_version_id IS NOT NULL" +
1133 1142 " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
1134 1143 " AND #{Version.table_name}.sharing <> 'system'",
1135 1144 :include => [:project, :fixed_version]
1136 1145 ).each do |issue|
1137 1146 next if issue.project.nil? || issue.fixed_version.nil?
1138 1147 unless issue.project.shared_versions.include?(issue.fixed_version)
1139 1148 issue.init_journal(User.current)
1140 1149 issue.fixed_version = nil
1141 1150 issue.save
1142 1151 end
1143 1152 end
1144 1153 end
1145 1154
1146 1155 # Callback on file attachment
1147 1156 def attachment_added(obj)
1148 1157 if @current_journal && !obj.new_record?
1149 1158 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
1150 1159 end
1151 1160 end
1152 1161
1153 1162 # Callback on attachment deletion
1154 1163 def attachment_removed(obj)
1155 1164 if @current_journal && !obj.new_record?
1156 1165 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
1157 1166 @current_journal.save
1158 1167 end
1159 1168 end
1160 1169
1161 1170 # Default assignment based on category
1162 1171 def default_assign
1163 1172 if assigned_to.nil? && category && category.assigned_to
1164 1173 self.assigned_to = category.assigned_to
1165 1174 end
1166 1175 end
1167 1176
1168 1177 # Updates start/due dates of following issues
1169 1178 def reschedule_following_issues
1170 1179 if start_date_changed? || due_date_changed?
1171 1180 relations_from.each do |relation|
1172 1181 relation.set_issue_to_dates
1173 1182 end
1174 1183 end
1175 1184 end
1176 1185
1177 1186 # Closes duplicates if the issue is being closed
1178 1187 def close_duplicates
1179 1188 if closing?
1180 1189 duplicates.each do |duplicate|
1181 1190 # Reload is need in case the duplicate was updated by a previous duplicate
1182 1191 duplicate.reload
1183 1192 # Don't re-close it if it's already closed
1184 1193 next if duplicate.closed?
1185 1194 # Same user and notes
1186 1195 if @current_journal
1187 1196 duplicate.init_journal(@current_journal.user, @current_journal.notes)
1188 1197 end
1189 1198 duplicate.update_attribute :status, self.status
1190 1199 end
1191 1200 end
1192 1201 end
1193 1202
1194 1203 # Make sure updated_on is updated when adding a note
1195 1204 def force_updated_on_change
1196 1205 if @current_journal
1197 1206 self.updated_on = current_time_from_proper_timezone
1198 1207 end
1199 1208 end
1200 1209
1201 1210 # Saves the changes in a Journal
1202 1211 # Called after_save
1203 1212 def create_journal
1204 1213 if @current_journal
1205 1214 # attributes changes
1206 1215 if @attributes_before_change
1207 1216 (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on)).each {|c|
1208 1217 before = @attributes_before_change[c]
1209 1218 after = send(c)
1210 1219 next if before == after || (before.blank? && after.blank?)
1211 1220 @current_journal.details << JournalDetail.new(:property => 'attr',
1212 1221 :prop_key => c,
1213 1222 :old_value => before,
1214 1223 :value => after)
1215 1224 }
1216 1225 end
1217 1226 if @custom_values_before_change
1218 1227 # custom fields changes
1219 1228 custom_field_values.each {|c|
1220 1229 before = @custom_values_before_change[c.custom_field_id]
1221 1230 after = c.value
1222 1231 next if before == after || (before.blank? && after.blank?)
1223 1232
1224 1233 if before.is_a?(Array) || after.is_a?(Array)
1225 1234 before = [before] unless before.is_a?(Array)
1226 1235 after = [after] unless after.is_a?(Array)
1227 1236
1228 1237 # values removed
1229 1238 (before - after).reject(&:blank?).each do |value|
1230 1239 @current_journal.details << JournalDetail.new(:property => 'cf',
1231 1240 :prop_key => c.custom_field_id,
1232 1241 :old_value => value,
1233 1242 :value => nil)
1234 1243 end
1235 1244 # values added
1236 1245 (after - before).reject(&:blank?).each do |value|
1237 1246 @current_journal.details << JournalDetail.new(:property => 'cf',
1238 1247 :prop_key => c.custom_field_id,
1239 1248 :old_value => nil,
1240 1249 :value => value)
1241 1250 end
1242 1251 else
1243 1252 @current_journal.details << JournalDetail.new(:property => 'cf',
1244 1253 :prop_key => c.custom_field_id,
1245 1254 :old_value => before,
1246 1255 :value => after)
1247 1256 end
1248 1257 }
1249 1258 end
1250 1259 @current_journal.save
1251 1260 # reset current journal
1252 1261 init_journal @current_journal.user, @current_journal.notes
1253 1262 end
1254 1263 end
1255 1264
1256 1265 # Query generator for selecting groups of issue counts for a project
1257 1266 # based on specific criteria
1258 1267 #
1259 1268 # Options
1260 1269 # * project - Project to search in.
1261 1270 # * field - String. Issue field to key off of in the grouping.
1262 1271 # * joins - String. The table name to join against.
1263 1272 def self.count_and_group_by(options)
1264 1273 project = options.delete(:project)
1265 1274 select_field = options.delete(:field)
1266 1275 joins = options.delete(:joins)
1267 1276
1268 1277 where = "#{Issue.table_name}.#{select_field}=j.id"
1269 1278
1270 1279 ActiveRecord::Base.connection.select_all("select s.id as status_id,
1271 1280 s.is_closed as closed,
1272 1281 j.id as #{select_field},
1273 1282 count(#{Issue.table_name}.id) as total
1274 1283 from
1275 1284 #{Issue.table_name}, #{Project.table_name}, #{IssueStatus.table_name} s, #{joins} j
1276 1285 where
1277 1286 #{Issue.table_name}.status_id=s.id
1278 1287 and #{where}
1279 1288 and #{Issue.table_name}.project_id=#{Project.table_name}.id
1280 1289 and #{visible_condition(User.current, :project => project)}
1281 1290 group by s.id, s.is_closed, j.id")
1282 1291 end
1283 1292 end
@@ -1,143 +1,147
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 IssueRelation < ActiveRecord::Base
19 19 belongs_to :issue_from, :class_name => 'Issue', :foreign_key => 'issue_from_id'
20 20 belongs_to :issue_to, :class_name => 'Issue', :foreign_key => 'issue_to_id'
21 21
22 22 TYPE_RELATES = "relates"
23 23 TYPE_DUPLICATES = "duplicates"
24 24 TYPE_DUPLICATED = "duplicated"
25 25 TYPE_BLOCKS = "blocks"
26 26 TYPE_BLOCKED = "blocked"
27 27 TYPE_PRECEDES = "precedes"
28 28 TYPE_FOLLOWS = "follows"
29 TYPE_COPIED_TO = "copied_to"
30 TYPE_COPIED_FROM = "copied_from"
29 31
30 32 TYPES = { TYPE_RELATES => { :name => :label_relates_to, :sym_name => :label_relates_to, :order => 1, :sym => TYPE_RELATES },
31 33 TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicated_by, :order => 2, :sym => TYPE_DUPLICATED },
32 34 TYPE_DUPLICATED => { :name => :label_duplicated_by, :sym_name => :label_duplicates, :order => 3, :sym => TYPE_DUPLICATES, :reverse => TYPE_DUPLICATES },
33 35 TYPE_BLOCKS => { :name => :label_blocks, :sym_name => :label_blocked_by, :order => 4, :sym => TYPE_BLOCKED },
34 36 TYPE_BLOCKED => { :name => :label_blocked_by, :sym_name => :label_blocks, :order => 5, :sym => TYPE_BLOCKS, :reverse => TYPE_BLOCKS },
35 37 TYPE_PRECEDES => { :name => :label_precedes, :sym_name => :label_follows, :order => 6, :sym => TYPE_FOLLOWS },
36 TYPE_FOLLOWS => { :name => :label_follows, :sym_name => :label_precedes, :order => 7, :sym => TYPE_PRECEDES, :reverse => TYPE_PRECEDES }
38 TYPE_FOLLOWS => { :name => :label_follows, :sym_name => :label_precedes, :order => 7, :sym => TYPE_PRECEDES, :reverse => TYPE_PRECEDES },
39 TYPE_COPIED_TO => { :name => :label_copied_to, :sym_name => :label_copied_from, :order => 8, :sym => TYPE_COPIED_FROM },
40 TYPE_COPIED_FROM => { :name => :label_copied_from, :sym_name => :label_copied_to, :order => 9, :sym => TYPE_COPIED_TO, :reverse => TYPE_COPIED_TO }
37 41 }.freeze
38 42
39 43 validates_presence_of :issue_from, :issue_to, :relation_type
40 44 validates_inclusion_of :relation_type, :in => TYPES.keys
41 45 validates_numericality_of :delay, :allow_nil => true
42 46 validates_uniqueness_of :issue_to_id, :scope => :issue_from_id
43 47
44 48 validate :validate_issue_relation
45 49
46 50 attr_protected :issue_from_id, :issue_to_id
47 51
48 52 before_save :handle_issue_order
49 53
50 54 def visible?(user=User.current)
51 55 (issue_from.nil? || issue_from.visible?(user)) && (issue_to.nil? || issue_to.visible?(user))
52 56 end
53 57
54 58 def deletable?(user=User.current)
55 59 visible?(user) &&
56 60 ((issue_from.nil? || user.allowed_to?(:manage_issue_relations, issue_from.project)) ||
57 61 (issue_to.nil? || user.allowed_to?(:manage_issue_relations, issue_to.project)))
58 62 end
59 63
60 64 def initialize(attributes=nil, *args)
61 65 super
62 66 if new_record?
63 67 if relation_type.blank?
64 68 self.relation_type = IssueRelation::TYPE_RELATES
65 69 end
66 70 end
67 71 end
68 72
69 73 def validate_issue_relation
70 74 if issue_from && issue_to
71 75 errors.add :issue_to_id, :invalid if issue_from_id == issue_to_id
72 76 errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations?
73 77 #detect circular dependencies depending wether the relation should be reversed
74 78 if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
75 79 errors.add :base, :circular_dependency if issue_from.all_dependent_issues.include? issue_to
76 80 else
77 81 errors.add :base, :circular_dependency if issue_to.all_dependent_issues.include? issue_from
78 82 end
79 83 errors.add :base, :cant_link_an_issue_with_a_descendant if issue_from.is_descendant_of?(issue_to) || issue_from.is_ancestor_of?(issue_to)
80 84 end
81 85 end
82 86
83 87 def other_issue(issue)
84 88 (self.issue_from_id == issue.id) ? issue_to : issue_from
85 89 end
86 90
87 91 # Returns the relation type for +issue+
88 92 def relation_type_for(issue)
89 93 if TYPES[relation_type]
90 94 if self.issue_from_id == issue.id
91 95 relation_type
92 96 else
93 97 TYPES[relation_type][:sym]
94 98 end
95 99 end
96 100 end
97 101
98 102 def label_for(issue)
99 103 TYPES[relation_type] ? TYPES[relation_type][(self.issue_from_id == issue.id) ? :name : :sym_name] : :unknow
100 104 end
101 105
102 106 def handle_issue_order
103 107 reverse_if_needed
104 108
105 109 if TYPE_PRECEDES == relation_type
106 110 self.delay ||= 0
107 111 else
108 112 self.delay = nil
109 113 end
110 114 set_issue_to_dates
111 115 end
112 116
113 117 def set_issue_to_dates
114 118 soonest_start = self.successor_soonest_start
115 119 if soonest_start && issue_to
116 120 issue_to.reschedule_after(soonest_start)
117 121 end
118 122 end
119 123
120 124 def successor_soonest_start
121 125 if (TYPE_PRECEDES == self.relation_type) && delay && issue_from && (issue_from.start_date || issue_from.due_date)
122 126 (issue_from.due_date || issue_from.start_date) + 1 + delay
123 127 end
124 128 end
125 129
126 130 def <=>(relation)
127 131 TYPES[self.relation_type][:order] <=> TYPES[relation.relation_type][:order]
128 132 end
129 133
130 134 private
131 135
132 136 # Reverses the relation if needed so that it gets stored in the proper way
133 137 # Should not be reversed before validation so that it can be displayed back
134 138 # as entered on new relation form
135 139 def reverse_if_needed
136 140 if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
137 141 issue_tmp = issue_to
138 142 self.issue_to = issue_from
139 143 self.issue_from = issue_tmp
140 144 self.relation_type = TYPES[relation_type][:reverse]
141 145 end
142 146 end
143 147 end
@@ -1,1062 +1,1064
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
335 335 setting_app_title: Application title
336 336 setting_app_subtitle: Application subtitle
337 337 setting_welcome_text: Welcome text
338 338 setting_default_language: Default language
339 339 setting_login_required: Authentication required
340 340 setting_self_registration: Self-registration
341 341 setting_attachment_max_size: Maximum attachment size
342 342 setting_issues_export_limit: Issues export limit
343 343 setting_mail_from: Emission email address
344 344 setting_bcc_recipients: Blind carbon copy recipients (bcc)
345 345 setting_plain_text_mail: Plain text mail (no HTML)
346 346 setting_host_name: Host name and path
347 347 setting_text_formatting: Text formatting
348 348 setting_wiki_compression: Wiki history compression
349 349 setting_feeds_limit: Maximum number of items in Atom feeds
350 350 setting_default_projects_public: New projects are public by default
351 351 setting_autofetch_changesets: Fetch commits automatically
352 352 setting_sys_api_enabled: Enable WS for repository management
353 353 setting_commit_ref_keywords: Referencing keywords
354 354 setting_commit_fix_keywords: Fixing keywords
355 355 setting_autologin: Autologin
356 356 setting_date_format: Date format
357 357 setting_time_format: Time format
358 358 setting_cross_project_issue_relations: Allow cross-project issue relations
359 359 setting_issue_list_default_columns: Default columns displayed on the issue list
360 360 setting_repositories_encodings: Attachments and repositories encodings
361 361 setting_emails_header: Emails header
362 362 setting_emails_footer: Emails footer
363 363 setting_protocol: Protocol
364 364 setting_per_page_options: Objects per page options
365 365 setting_user_format: Users display format
366 366 setting_activity_days_default: Days displayed on project activity
367 367 setting_display_subprojects_issues: Display subprojects issues on main projects by default
368 368 setting_enabled_scm: Enabled SCM
369 369 setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
370 370 setting_mail_handler_api_enabled: Enable WS for incoming emails
371 371 setting_mail_handler_api_key: API key
372 372 setting_sequential_project_identifiers: Generate sequential project identifiers
373 373 setting_gravatar_enabled: Use Gravatar user icons
374 374 setting_gravatar_default: Default Gravatar image
375 375 setting_diff_max_lines_displayed: Maximum number of diff lines displayed
376 376 setting_file_max_size_displayed: Maximum size of text files displayed inline
377 377 setting_repository_log_display_limit: Maximum number of revisions displayed on file log
378 378 setting_openid: Allow OpenID login and registration
379 379 setting_password_min_length: Minimum password length
380 380 setting_new_project_user_role_id: Role given to a non-admin user who creates a project
381 381 setting_default_projects_modules: Default enabled modules for new projects
382 382 setting_issue_done_ratio: Calculate the issue done ratio with
383 383 setting_issue_done_ratio_issue_field: Use the issue field
384 384 setting_issue_done_ratio_issue_status: Use the issue status
385 385 setting_start_of_week: Start calendars on
386 386 setting_rest_api_enabled: Enable REST web service
387 387 setting_cache_formatted_text: Cache formatted text
388 388 setting_default_notification_option: Default notification option
389 389 setting_commit_logtime_enabled: Enable time logging
390 390 setting_commit_logtime_activity_id: Activity for logged time
391 391 setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
392 392 setting_issue_group_assignment: Allow issue assignment to groups
393 393 setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues
394 394 setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed
395 395 setting_unsubscribe: Allow users to delete their own account
396 396 setting_session_lifetime: Session maximum lifetime
397 397 setting_session_timeout: Session inactivity timeout
398 398 setting_thumbnails_enabled: Display attachment thumbnails
399 399 setting_thumbnails_size: Thumbnails size (in pixels)
400 400
401 401 permission_add_project: Create project
402 402 permission_add_subprojects: Create subprojects
403 403 permission_edit_project: Edit project
404 404 permission_close_project: Close / reopen the project
405 405 permission_select_project_modules: Select project modules
406 406 permission_manage_members: Manage members
407 407 permission_manage_project_activities: Manage project activities
408 408 permission_manage_versions: Manage versions
409 409 permission_manage_categories: Manage issue categories
410 410 permission_view_issues: View Issues
411 411 permission_add_issues: Add issues
412 412 permission_edit_issues: Edit issues
413 413 permission_manage_issue_relations: Manage issue relations
414 414 permission_set_issues_private: Set issues public or private
415 415 permission_set_own_issues_private: Set own issues public or private
416 416 permission_add_issue_notes: Add notes
417 417 permission_edit_issue_notes: Edit notes
418 418 permission_edit_own_issue_notes: Edit own notes
419 419 permission_move_issues: Move issues
420 420 permission_delete_issues: Delete issues
421 421 permission_manage_public_queries: Manage public queries
422 422 permission_save_queries: Save queries
423 423 permission_view_gantt: View gantt chart
424 424 permission_view_calendar: View calendar
425 425 permission_view_issue_watchers: View watchers list
426 426 permission_add_issue_watchers: Add watchers
427 427 permission_delete_issue_watchers: Delete watchers
428 428 permission_log_time: Log spent time
429 429 permission_view_time_entries: View spent time
430 430 permission_edit_time_entries: Edit time logs
431 431 permission_edit_own_time_entries: Edit own time logs
432 432 permission_manage_news: Manage news
433 433 permission_comment_news: Comment news
434 434 permission_manage_documents: Manage documents
435 435 permission_view_documents: View documents
436 436 permission_manage_files: Manage files
437 437 permission_view_files: View files
438 438 permission_manage_wiki: Manage wiki
439 439 permission_rename_wiki_pages: Rename wiki pages
440 440 permission_delete_wiki_pages: Delete wiki pages
441 441 permission_view_wiki_pages: View wiki
442 442 permission_view_wiki_edits: View wiki history
443 443 permission_edit_wiki_pages: Edit wiki pages
444 444 permission_delete_wiki_pages_attachments: Delete attachments
445 445 permission_protect_wiki_pages: Protect wiki pages
446 446 permission_manage_repository: Manage repository
447 447 permission_browse_repository: Browse repository
448 448 permission_view_changesets: View changesets
449 449 permission_commit_access: Commit access
450 450 permission_manage_boards: Manage forums
451 451 permission_view_messages: View messages
452 452 permission_add_messages: Post messages
453 453 permission_edit_messages: Edit messages
454 454 permission_edit_own_messages: Edit own messages
455 455 permission_delete_messages: Delete messages
456 456 permission_delete_own_messages: Delete own messages
457 457 permission_export_wiki_pages: Export wiki pages
458 458 permission_manage_subtasks: Manage subtasks
459 459 permission_manage_related_issues: Manage related issues
460 460
461 461 project_module_issue_tracking: Issue tracking
462 462 project_module_time_tracking: Time tracking
463 463 project_module_news: News
464 464 project_module_documents: Documents
465 465 project_module_files: Files
466 466 project_module_wiki: Wiki
467 467 project_module_repository: Repository
468 468 project_module_boards: Forums
469 469 project_module_calendar: Calendar
470 470 project_module_gantt: Gantt
471 471
472 472 label_user: User
473 473 label_user_plural: Users
474 474 label_user_new: New user
475 475 label_user_anonymous: Anonymous
476 476 label_project: Project
477 477 label_project_new: New project
478 478 label_project_plural: Projects
479 479 label_x_projects:
480 480 zero: no projects
481 481 one: 1 project
482 482 other: "%{count} projects"
483 483 label_project_all: All Projects
484 484 label_project_latest: Latest projects
485 485 label_issue: Issue
486 486 label_issue_new: New issue
487 487 label_issue_plural: Issues
488 488 label_issue_view_all: View all issues
489 489 label_issues_by: "Issues by %{value}"
490 490 label_issue_added: Issue added
491 491 label_issue_updated: Issue updated
492 492 label_issue_note_added: Note added
493 493 label_issue_status_updated: Status updated
494 494 label_issue_priority_updated: Priority updated
495 495 label_document: Document
496 496 label_document_new: New document
497 497 label_document_plural: Documents
498 498 label_document_added: Document added
499 499 label_role: Role
500 500 label_role_plural: Roles
501 501 label_role_new: New role
502 502 label_role_and_permissions: Roles and permissions
503 503 label_role_anonymous: Anonymous
504 504 label_role_non_member: Non member
505 505 label_member: Member
506 506 label_member_new: New member
507 507 label_member_plural: Members
508 508 label_tracker: Tracker
509 509 label_tracker_plural: Trackers
510 510 label_tracker_new: New tracker
511 511 label_workflow: Workflow
512 512 label_issue_status: Issue status
513 513 label_issue_status_plural: Issue statuses
514 514 label_issue_status_new: New status
515 515 label_issue_category: Issue category
516 516 label_issue_category_plural: Issue categories
517 517 label_issue_category_new: New category
518 518 label_custom_field: Custom field
519 519 label_custom_field_plural: Custom fields
520 520 label_custom_field_new: New custom field
521 521 label_enumerations: Enumerations
522 522 label_enumeration_new: New value
523 523 label_information: Information
524 524 label_information_plural: Information
525 525 label_please_login: Please log in
526 526 label_register: Register
527 527 label_login_with_open_id_option: or login with OpenID
528 528 label_password_lost: Lost password
529 529 label_home: Home
530 530 label_my_page: My page
531 531 label_my_account: My account
532 532 label_my_projects: My projects
533 533 label_my_page_block: My page block
534 534 label_administration: Administration
535 535 label_login: Sign in
536 536 label_logout: Sign out
537 537 label_help: Help
538 538 label_reported_issues: Reported issues
539 539 label_assigned_to_me_issues: Issues assigned to me
540 540 label_last_login: Last connection
541 541 label_registered_on: Registered on
542 542 label_activity: Activity
543 543 label_overall_activity: Overall activity
544 544 label_user_activity: "%{value}'s activity"
545 545 label_new: New
546 546 label_logged_as: Logged in as
547 547 label_environment: Environment
548 548 label_authentication: Authentication
549 549 label_auth_source: Authentication mode
550 550 label_auth_source_new: New authentication mode
551 551 label_auth_source_plural: Authentication modes
552 552 label_subproject_plural: Subprojects
553 553 label_subproject_new: New subproject
554 554 label_and_its_subprojects: "%{value} and its subprojects"
555 555 label_min_max_length: Min - Max length
556 556 label_list: List
557 557 label_date: Date
558 558 label_integer: Integer
559 559 label_float: Float
560 560 label_boolean: Boolean
561 561 label_string: Text
562 562 label_text: Long text
563 563 label_attribute: Attribute
564 564 label_attribute_plural: Attributes
565 565 label_download: "%{count} Download"
566 566 label_download_plural: "%{count} Downloads"
567 567 label_no_data: No data to display
568 568 label_change_status: Change status
569 569 label_history: History
570 570 label_attachment: File
571 571 label_attachment_new: New file
572 572 label_attachment_delete: Delete file
573 573 label_attachment_plural: Files
574 574 label_file_added: File added
575 575 label_report: Report
576 576 label_report_plural: Reports
577 577 label_news: News
578 578 label_news_new: Add news
579 579 label_news_plural: News
580 580 label_news_latest: Latest news
581 581 label_news_view_all: View all news
582 582 label_news_added: News added
583 583 label_news_comment_added: Comment added to a news
584 584 label_settings: Settings
585 585 label_overview: Overview
586 586 label_version: Version
587 587 label_version_new: New version
588 588 label_version_plural: Versions
589 589 label_close_versions: Close completed versions
590 590 label_confirmation: Confirmation
591 591 label_export_to: 'Also available in:'
592 592 label_read: Read...
593 593 label_public_projects: Public projects
594 594 label_open_issues: open
595 595 label_open_issues_plural: open
596 596 label_closed_issues: closed
597 597 label_closed_issues_plural: closed
598 598 label_x_open_issues_abbr_on_total:
599 599 zero: 0 open / %{total}
600 600 one: 1 open / %{total}
601 601 other: "%{count} open / %{total}"
602 602 label_x_open_issues_abbr:
603 603 zero: 0 open
604 604 one: 1 open
605 605 other: "%{count} open"
606 606 label_x_closed_issues_abbr:
607 607 zero: 0 closed
608 608 one: 1 closed
609 609 other: "%{count} closed"
610 610 label_x_issues:
611 611 zero: 0 issues
612 612 one: 1 issue
613 613 other: "%{count} issues"
614 614 label_total: Total
615 615 label_permissions: Permissions
616 616 label_current_status: Current status
617 617 label_new_statuses_allowed: New statuses allowed
618 618 label_all: all
619 619 label_none: none
620 620 label_nobody: nobody
621 621 label_next: Next
622 622 label_previous: Previous
623 623 label_used_by: Used by
624 624 label_details: Details
625 625 label_add_note: Add a note
626 626 label_per_page: Per page
627 627 label_calendar: Calendar
628 628 label_months_from: months from
629 629 label_gantt: Gantt
630 630 label_internal: Internal
631 631 label_last_changes: "last %{count} changes"
632 632 label_change_view_all: View all changes
633 633 label_personalize_page: Personalize this page
634 634 label_comment: Comment
635 635 label_comment_plural: Comments
636 636 label_x_comments:
637 637 zero: no comments
638 638 one: 1 comment
639 639 other: "%{count} comments"
640 640 label_comment_add: Add a comment
641 641 label_comment_added: Comment added
642 642 label_comment_delete: Delete comments
643 643 label_query: Custom query
644 644 label_query_plural: Custom queries
645 645 label_query_new: New query
646 646 label_my_queries: My custom queries
647 647 label_filter_add: Add filter
648 648 label_filter_plural: Filters
649 649 label_equals: is
650 650 label_not_equals: is not
651 651 label_in_less_than: in less than
652 652 label_in_more_than: in more than
653 653 label_greater_or_equal: '>='
654 654 label_less_or_equal: '<='
655 655 label_between: between
656 656 label_in: in
657 657 label_today: today
658 658 label_all_time: all time
659 659 label_yesterday: yesterday
660 660 label_this_week: this week
661 661 label_last_week: last week
662 662 label_last_n_days: "last %{count} days"
663 663 label_this_month: this month
664 664 label_last_month: last month
665 665 label_this_year: this year
666 666 label_date_range: Date range
667 667 label_less_than_ago: less than days ago
668 668 label_more_than_ago: more than days ago
669 669 label_ago: days ago
670 670 label_contains: contains
671 671 label_not_contains: doesn't contain
672 672 label_day_plural: days
673 673 label_repository: Repository
674 674 label_repository_new: New repository
675 675 label_repository_plural: Repositories
676 676 label_browse: Browse
677 677 label_modification: "%{count} change"
678 678 label_modification_plural: "%{count} changes"
679 679 label_branch: Branch
680 680 label_tag: Tag
681 681 label_revision: Revision
682 682 label_revision_plural: Revisions
683 683 label_revision_id: "Revision %{value}"
684 684 label_associated_revisions: Associated revisions
685 685 label_added: added
686 686 label_modified: modified
687 687 label_copied: copied
688 688 label_renamed: renamed
689 689 label_deleted: deleted
690 690 label_latest_revision: Latest revision
691 691 label_latest_revision_plural: Latest revisions
692 692 label_view_revisions: View revisions
693 693 label_view_all_revisions: View all revisions
694 694 label_max_size: Maximum size
695 695 label_sort_highest: Move to top
696 696 label_sort_higher: Move up
697 697 label_sort_lower: Move down
698 698 label_sort_lowest: Move to bottom
699 699 label_roadmap: Roadmap
700 700 label_roadmap_due_in: "Due in %{value}"
701 701 label_roadmap_overdue: "%{value} late"
702 702 label_roadmap_no_issues: No issues for this version
703 703 label_search: Search
704 704 label_result_plural: Results
705 705 label_all_words: All words
706 706 label_wiki: Wiki
707 707 label_wiki_edit: Wiki edit
708 708 label_wiki_edit_plural: Wiki edits
709 709 label_wiki_page: Wiki page
710 710 label_wiki_page_plural: Wiki pages
711 711 label_index_by_title: Index by title
712 712 label_index_by_date: Index by date
713 713 label_current_version: Current version
714 714 label_preview: Preview
715 715 label_feed_plural: Feeds
716 716 label_changes_details: Details of all changes
717 717 label_issue_tracking: Issue tracking
718 718 label_spent_time: Spent time
719 719 label_overall_spent_time: Overall spent time
720 720 label_f_hour: "%{value} hour"
721 721 label_f_hour_plural: "%{value} hours"
722 722 label_time_tracking: Time tracking
723 723 label_change_plural: Changes
724 724 label_statistics: Statistics
725 725 label_commits_per_month: Commits per month
726 726 label_commits_per_author: Commits per author
727 727 label_diff: diff
728 728 label_view_diff: View differences
729 729 label_diff_inline: inline
730 730 label_diff_side_by_side: side by side
731 731 label_options: Options
732 732 label_copy_workflow_from: Copy workflow from
733 733 label_permissions_report: Permissions report
734 734 label_watched_issues: Watched issues
735 735 label_related_issues: Related issues
736 736 label_applied_status: Applied status
737 737 label_loading: Loading...
738 738 label_relation_new: New relation
739 739 label_relation_delete: Delete relation
740 740 label_relates_to: related to
741 741 label_duplicates: duplicates
742 742 label_duplicated_by: duplicated by
743 743 label_blocks: blocks
744 744 label_blocked_by: blocked by
745 745 label_precedes: precedes
746 746 label_follows: follows
747 label_copied_to: copied to
748 label_copied_from: copied from
747 749 label_end_to_start: end to start
748 750 label_end_to_end: end to end
749 751 label_start_to_start: start to start
750 752 label_start_to_end: start to end
751 753 label_stay_logged_in: Stay logged in
752 754 label_disabled: disabled
753 755 label_show_completed_versions: Show completed versions
754 756 label_me: me
755 757 label_board: Forum
756 758 label_board_new: New forum
757 759 label_board_plural: Forums
758 760 label_board_locked: Locked
759 761 label_board_sticky: Sticky
760 762 label_topic_plural: Topics
761 763 label_message_plural: Messages
762 764 label_message_last: Last message
763 765 label_message_new: New message
764 766 label_message_posted: Message added
765 767 label_reply_plural: Replies
766 768 label_send_information: Send account information to the user
767 769 label_year: Year
768 770 label_month: Month
769 771 label_week: Week
770 772 label_date_from: From
771 773 label_date_to: To
772 774 label_language_based: Based on user's language
773 775 label_sort_by: "Sort by %{value}"
774 776 label_send_test_email: Send a test email
775 777 label_feeds_access_key: RSS access key
776 778 label_missing_feeds_access_key: Missing a RSS access key
777 779 label_feeds_access_key_created_on: "RSS access key created %{value} ago"
778 780 label_module_plural: Modules
779 781 label_added_time_by: "Added by %{author} %{age} ago"
780 782 label_updated_time_by: "Updated by %{author} %{age} ago"
781 783 label_updated_time: "Updated %{value} ago"
782 784 label_jump_to_a_project: Jump to a project...
783 785 label_file_plural: Files
784 786 label_changeset_plural: Changesets
785 787 label_default_columns: Default columns
786 788 label_no_change_option: (No change)
787 789 label_bulk_edit_selected_issues: Bulk edit selected issues
788 790 label_bulk_edit_selected_time_entries: Bulk edit selected time entries
789 791 label_theme: Theme
790 792 label_default: Default
791 793 label_search_titles_only: Search titles only
792 794 label_user_mail_option_all: "For any event on all my projects"
793 795 label_user_mail_option_selected: "For any event on the selected projects only..."
794 796 label_user_mail_option_none: "No events"
795 797 label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in"
796 798 label_user_mail_option_only_assigned: "Only for things I am assigned to"
797 799 label_user_mail_option_only_owner: "Only for things I am the owner of"
798 800 label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
799 801 label_registration_activation_by_email: account activation by email
800 802 label_registration_manual_activation: manual account activation
801 803 label_registration_automatic_activation: automatic account activation
802 804 label_display_per_page: "Per page: %{value}"
803 805 label_age: Age
804 806 label_change_properties: Change properties
805 807 label_general: General
806 808 label_more: More
807 809 label_scm: SCM
808 810 label_plugins: Plugins
809 811 label_ldap_authentication: LDAP authentication
810 812 label_downloads_abbr: D/L
811 813 label_optional_description: Optional description
812 814 label_add_another_file: Add another file
813 815 label_preferences: Preferences
814 816 label_chronological_order: In chronological order
815 817 label_reverse_chronological_order: In reverse chronological order
816 818 label_planning: Planning
817 819 label_incoming_emails: Incoming emails
818 820 label_generate_key: Generate a key
819 821 label_issue_watchers: Watchers
820 822 label_example: Example
821 823 label_display: Display
822 824 label_sort: Sort
823 825 label_ascending: Ascending
824 826 label_descending: Descending
825 827 label_date_from_to: From %{start} to %{end}
826 828 label_wiki_content_added: Wiki page added
827 829 label_wiki_content_updated: Wiki page updated
828 830 label_group: Group
829 831 label_group_plural: Groups
830 832 label_group_new: New group
831 833 label_time_entry_plural: Spent time
832 834 label_version_sharing_none: Not shared
833 835 label_version_sharing_descendants: With subprojects
834 836 label_version_sharing_hierarchy: With project hierarchy
835 837 label_version_sharing_tree: With project tree
836 838 label_version_sharing_system: With all projects
837 839 label_update_issue_done_ratios: Update issue done ratios
838 840 label_copy_source: Source
839 841 label_copy_target: Target
840 842 label_copy_same_as_target: Same as target
841 843 label_display_used_statuses_only: Only display statuses that are used by this tracker
842 844 label_api_access_key: API access key
843 845 label_missing_api_access_key: Missing an API access key
844 846 label_api_access_key_created_on: "API access key created %{value} ago"
845 847 label_profile: Profile
846 848 label_subtask_plural: Subtasks
847 849 label_project_copy_notifications: Send email notifications during the project copy
848 850 label_principal_search: "Search for user or group:"
849 851 label_user_search: "Search for user:"
850 852 label_additional_workflow_transitions_for_author: Additional transitions allowed when the user is the author
851 853 label_additional_workflow_transitions_for_assignee: Additional transitions allowed when the user is the assignee
852 854 label_issues_visibility_all: All issues
853 855 label_issues_visibility_public: All non private issues
854 856 label_issues_visibility_own: Issues created by or assigned to the user
855 857 label_git_report_last_commit: Report last commit for files and directories
856 858 label_parent_revision: Parent
857 859 label_child_revision: Child
858 860 label_export_options: "%{export_format} export options"
859 861 label_copy_attachments: Copy attachments
860 862 label_copy_subtasks: Copy subtasks
861 863 label_item_position: "%{position} of %{count}"
862 864 label_completed_versions: Completed versions
863 865 label_search_for_watchers: Search for watchers to add
864 866 label_session_expiration: Session expiration
865 867 label_show_closed_projects: View closed projects
866 868 label_status_transitions: Status transitions
867 869 label_fields_permissions: Fields permissions
868 870 label_readonly: Read-only
869 871 label_required: Required
870 872 label_attribute_of_project: "Project's %{name}"
871 873 label_attribute_of_author: "Author's %{name}"
872 874 label_attribute_of_assigned_to: "Assignee's %{name}"
873 875 label_attribute_of_fixed_version: "Target version's %{name}"
874 876
875 877 button_login: Login
876 878 button_submit: Submit
877 879 button_save: Save
878 880 button_check_all: Check all
879 881 button_uncheck_all: Uncheck all
880 882 button_collapse_all: Collapse all
881 883 button_expand_all: Expand all
882 884 button_delete: Delete
883 885 button_create: Create
884 886 button_create_and_continue: Create and continue
885 887 button_test: Test
886 888 button_edit: Edit
887 889 button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
888 890 button_add: Add
889 891 button_change: Change
890 892 button_apply: Apply
891 893 button_clear: Clear
892 894 button_lock: Lock
893 895 button_unlock: Unlock
894 896 button_download: Download
895 897 button_list: List
896 898 button_view: View
897 899 button_move: Move
898 900 button_move_and_follow: Move and follow
899 901 button_back: Back
900 902 button_cancel: Cancel
901 903 button_activate: Activate
902 904 button_sort: Sort
903 905 button_log_time: Log time
904 906 button_rollback: Rollback to this version
905 907 button_watch: Watch
906 908 button_unwatch: Unwatch
907 909 button_reply: Reply
908 910 button_archive: Archive
909 911 button_unarchive: Unarchive
910 912 button_reset: Reset
911 913 button_rename: Rename
912 914 button_change_password: Change password
913 915 button_copy: Copy
914 916 button_copy_and_follow: Copy and follow
915 917 button_annotate: Annotate
916 918 button_update: Update
917 919 button_configure: Configure
918 920 button_quote: Quote
919 921 button_duplicate: Duplicate
920 922 button_show: Show
921 923 button_edit_section: Edit this section
922 924 button_export: Export
923 925 button_delete_my_account: Delete my account
924 926 button_close: Close
925 927 button_reopen: Reopen
926 928
927 929 status_active: active
928 930 status_registered: registered
929 931 status_locked: locked
930 932
931 933 project_status_active: active
932 934 project_status_closed: closed
933 935 project_status_archived: archived
934 936
935 937 version_status_open: open
936 938 version_status_locked: locked
937 939 version_status_closed: closed
938 940
939 941 field_active: Active
940 942
941 943 text_select_mail_notifications: Select actions for which email notifications should be sent.
942 944 text_regexp_info: eg. ^[A-Z0-9]+$
943 945 text_min_max_length_info: 0 means no restriction
944 946 text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
945 947 text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
946 948 text_workflow_edit: Select a role and a tracker to edit the workflow
947 949 text_are_you_sure: Are you sure?
948 950 text_are_you_sure_with_children: "Delete issue and all child issues?"
949 951 text_journal_changed: "%{label} changed from %{old} to %{new}"
950 952 text_journal_changed_no_detail: "%{label} updated"
951 953 text_journal_set_to: "%{label} set to %{value}"
952 954 text_journal_deleted: "%{label} deleted (%{old})"
953 955 text_journal_added: "%{label} %{value} added"
954 956 text_tip_issue_begin_day: issue beginning this day
955 957 text_tip_issue_end_day: issue ending this day
956 958 text_tip_issue_begin_end_day: issue beginning and ending this day
957 959 text_project_identifier_info: 'Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />Once saved, the identifier cannot be changed.'
958 960 text_caracters_maximum: "%{count} characters maximum."
959 961 text_caracters_minimum: "Must be at least %{count} characters long."
960 962 text_length_between: "Length between %{min} and %{max} characters."
961 963 text_tracker_no_workflow: No workflow defined for this tracker
962 964 text_unallowed_characters: Unallowed characters
963 965 text_comma_separated: Multiple values allowed (comma separated).
964 966 text_line_separated: Multiple values allowed (one line for each value).
965 967 text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
966 968 text_issue_added: "Issue %{id} has been reported by %{author}."
967 969 text_issue_updated: "Issue %{id} has been updated by %{author}."
968 970 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
969 971 text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
970 972 text_issue_category_destroy_assignments: Remove category assignments
971 973 text_issue_category_reassign_to: Reassign issues to this category
972 974 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)."
973 975 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."
974 976 text_load_default_configuration: Load the default configuration
975 977 text_status_changed_by_changeset: "Applied in changeset %{value}."
976 978 text_time_logged_by_changeset: "Applied in changeset %{value}."
977 979 text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
978 980 text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
979 981 text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
980 982 text_select_project_modules: 'Select modules to enable for this project:'
981 983 text_default_administrator_account_changed: Default administrator account changed
982 984 text_file_repository_writable: Attachments directory writable
983 985 text_plugin_assets_writable: Plugin assets directory writable
984 986 text_rmagick_available: RMagick available (optional)
985 987 text_destroy_time_entries_question: "%{hours} hours were reported on the issues you are about to delete. What do you want to do?"
986 988 text_destroy_time_entries: Delete reported hours
987 989 text_assign_time_entries_to_project: Assign reported hours to the project
988 990 text_reassign_time_entries: 'Reassign reported hours to this issue:'
989 991 text_user_wrote: "%{value} wrote:"
990 992 text_enumeration_destroy_question: "%{count} objects are assigned to this value."
991 993 text_enumeration_category_reassign_to: 'Reassign them to this value:'
992 994 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."
993 995 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."
994 996 text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
995 997 text_custom_field_possible_values_info: 'One line for each value'
996 998 text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?"
997 999 text_wiki_page_nullify_children: "Keep child pages as root pages"
998 1000 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
999 1001 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
1000 1002 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?"
1001 1003 text_zoom_in: Zoom in
1002 1004 text_zoom_out: Zoom out
1003 1005 text_warn_on_leaving_unsaved: "The current page contains unsaved text that will be lost if you leave this page."
1004 1006 text_scm_path_encoding_note: "Default: UTF-8"
1005 1007 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1006 1008 text_mercurial_repository_note: Local repository (e.g. /hgrepo, c:\hgrepo)
1007 1009 text_scm_command: Command
1008 1010 text_scm_command_version: Version
1009 1011 text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
1010 1012 text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
1011 1013 text_issue_conflict_resolution_overwrite: "Apply my changes anyway (previous notes will be kept but some changes may be overwritten)"
1012 1014 text_issue_conflict_resolution_add_notes: "Add my notes and discard my other changes"
1013 1015 text_issue_conflict_resolution_cancel: "Discard all my changes and redisplay %{link}"
1014 1016 text_account_destroy_confirmation: "Are you sure you want to proceed?\nYour account will be permanently deleted, with no way to reactivate it."
1015 1017 text_session_expiration_settings: "Warning: changing these settings may expire the current sessions including yours."
1016 1018 text_project_closed: This project is closed and read-only.
1017 1019
1018 1020 default_role_manager: Manager
1019 1021 default_role_developer: Developer
1020 1022 default_role_reporter: Reporter
1021 1023 default_tracker_bug: Bug
1022 1024 default_tracker_feature: Feature
1023 1025 default_tracker_support: Support
1024 1026 default_issue_status_new: New
1025 1027 default_issue_status_in_progress: In Progress
1026 1028 default_issue_status_resolved: Resolved
1027 1029 default_issue_status_feedback: Feedback
1028 1030 default_issue_status_closed: Closed
1029 1031 default_issue_status_rejected: Rejected
1030 1032 default_doc_category_user: User documentation
1031 1033 default_doc_category_tech: Technical documentation
1032 1034 default_priority_low: Low
1033 1035 default_priority_normal: Normal
1034 1036 default_priority_high: High
1035 1037 default_priority_urgent: Urgent
1036 1038 default_priority_immediate: Immediate
1037 1039 default_activity_design: Design
1038 1040 default_activity_development: Development
1039 1041
1040 1042 enumeration_issue_priorities: Issue priorities
1041 1043 enumeration_doc_categories: Document categories
1042 1044 enumeration_activities: Activities (time tracking)
1043 1045 enumeration_system_activity: System Activity
1044 1046 description_filter: Filter
1045 1047 description_search: Searchfield
1046 1048 description_choose_project: Projects
1047 1049 description_project_scope: Search scope
1048 1050 description_notes: Notes
1049 1051 description_message_content: Message content
1050 1052 description_query_sort_criteria_attribute: Sort attribute
1051 1053 description_query_sort_criteria_direction: Sort direction
1052 1054 description_user_mail_notification: Mail notification settings
1053 1055 description_available_columns: Available Columns
1054 1056 description_selected_columns: Selected Columns
1055 1057 description_all_columns: All Columns
1056 1058 description_issue_category_reassign: Choose issue category
1057 1059 description_wiki_subpages_reassign: Choose new parent page
1058 1060 description_date_range_list: Choose range from list
1059 1061 description_date_range_interval: Choose range by selecting start and end date
1060 1062 description_date_from: Enter start date
1061 1063 description_date_to: Enter end date
1062 1064 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,1079 +1,1081
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
334 334 setting_app_title: Titre de l'application
335 335 setting_app_subtitle: Sous-titre de l'application
336 336 setting_welcome_text: Texte d'accueil
337 337 setting_default_language: Langue par dΓ©faut
338 338 setting_login_required: Authentification obligatoire
339 339 setting_self_registration: Inscription des nouveaux utilisateurs
340 340 setting_attachment_max_size: Taille maximale des fichiers
341 341 setting_issues_export_limit: Limite d'exportation des demandes
342 342 setting_mail_from: Adresse d'Γ©mission
343 343 setting_bcc_recipients: Destinataires en copie cachΓ©e (cci)
344 344 setting_plain_text_mail: Mail en texte brut (non HTML)
345 345 setting_host_name: Nom d'hΓ΄te et chemin
346 346 setting_text_formatting: Formatage du texte
347 347 setting_wiki_compression: Compression de l'historique des pages wiki
348 348 setting_feeds_limit: Nombre maximal d'Γ©lΓ©ments dans les flux Atom
349 349 setting_default_projects_public: DΓ©finir les nouveaux projets comme publics par dΓ©faut
350 350 setting_autofetch_changesets: RΓ©cupΓ©ration automatique des commits
351 351 setting_sys_api_enabled: Activer les WS pour la gestion des dΓ©pΓ΄ts
352 352 setting_commit_ref_keywords: Mots-clΓ©s de rΓ©fΓ©rencement
353 353 setting_commit_fix_keywords: Mots-clΓ©s de rΓ©solution
354 354 setting_autologin: DurΓ©e maximale de connexion automatique
355 355 setting_date_format: Format de date
356 356 setting_time_format: Format d'heure
357 357 setting_cross_project_issue_relations: Autoriser les relations entre demandes de diffΓ©rents projets
358 358 setting_issue_list_default_columns: Colonnes affichΓ©es par dΓ©faut sur la liste des demandes
359 359 setting_emails_footer: Pied-de-page des emails
360 360 setting_protocol: Protocole
361 361 setting_per_page_options: Options d'objets affichΓ©s par page
362 362 setting_user_format: Format d'affichage des utilisateurs
363 363 setting_activity_days_default: Nombre de jours affichΓ©s sur l'activitΓ© des projets
364 364 setting_display_subprojects_issues: Afficher par dΓ©faut les demandes des sous-projets sur les projets principaux
365 365 setting_enabled_scm: SCM activΓ©s
366 366 setting_mail_handler_body_delimiters: "Tronquer les emails après l'une de ces lignes"
367 367 setting_mail_handler_api_enabled: "Activer le WS pour la rΓ©ception d'emails"
368 368 setting_mail_handler_api_key: ClΓ© de protection de l'API
369 369 setting_sequential_project_identifiers: GΓ©nΓ©rer des identifiants de projet sΓ©quentiels
370 370 setting_gravatar_enabled: Afficher les Gravatar des utilisateurs
371 371 setting_diff_max_lines_displayed: Nombre maximum de lignes de diff affichΓ©es
372 372 setting_file_max_size_displayed: Taille maximum des fichiers texte affichΓ©s en ligne
373 373 setting_repository_log_display_limit: "Nombre maximum de rΓ©visions affichΓ©es sur l'historique d'un fichier"
374 374 setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
375 375 setting_password_min_length: Longueur minimum des mots de passe
376 376 setting_new_project_user_role_id: RΓ΄le donnΓ© Γ  un utilisateur non-administrateur qui crΓ©e un projet
377 377 setting_default_projects_modules: Modules activΓ©s par dΓ©faut pour les nouveaux projets
378 378 setting_issue_done_ratio: Calcul de l'avancement des demandes
379 379 setting_issue_done_ratio_issue_status: Utiliser le statut
380 380 setting_issue_done_ratio_issue_field: 'Utiliser le champ % effectuΓ©'
381 381 setting_rest_api_enabled: Activer l'API REST
382 382 setting_gravatar_default: Image Gravatar par dΓ©faut
383 383 setting_start_of_week: Jour de dΓ©but des calendriers
384 384 setting_cache_formatted_text: Mettre en cache le texte formatΓ©
385 385 setting_commit_logtime_enabled: Permettre la saisie de temps
386 386 setting_commit_logtime_activity_id: ActivitΓ© pour le temps saisi
387 387 setting_gantt_items_limit: Nombre maximum d'Γ©lΓ©ments affichΓ©s sur le gantt
388 388 setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes
389 389 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
390 390 setting_commit_cross_project_ref: Permettre le rΓ©fΓ©rencement et la rΓ©solution des demandes de tous les autres projets
391 391 setting_unsubscribe: Permettre aux utilisateurs de supprimer leur propre compte
392 392 setting_session_lifetime: DurΓ©e de vie maximale des sessions
393 393 setting_session_timeout: DurΓ©e maximale d'inactivitΓ©
394 394 setting_thumbnails_enabled: Afficher les vignettes des images
395 395 setting_thumbnails_size: Taille des vignettes (en pixels)
396 396
397 397 permission_add_project: CrΓ©er un projet
398 398 permission_add_subprojects: CrΓ©er des sous-projets
399 399 permission_edit_project: Modifier le projet
400 400 permission_close_project: Fermer / rΓ©ouvrir le projet
401 401 permission_select_project_modules: Choisir les modules
402 402 permission_manage_members: GΓ©rer les membres
403 403 permission_manage_versions: GΓ©rer les versions
404 404 permission_manage_categories: GΓ©rer les catΓ©gories de demandes
405 405 permission_view_issues: Voir les demandes
406 406 permission_add_issues: CrΓ©er des demandes
407 407 permission_edit_issues: Modifier les demandes
408 408 permission_manage_issue_relations: GΓ©rer les relations
409 409 permission_set_issues_private: Rendre les demandes publiques ou privΓ©es
410 410 permission_set_own_issues_private: Rendre ses propres demandes publiques ou privΓ©es
411 411 permission_add_issue_notes: Ajouter des notes
412 412 permission_edit_issue_notes: Modifier les notes
413 413 permission_edit_own_issue_notes: Modifier ses propres notes
414 414 permission_move_issues: DΓ©placer les demandes
415 415 permission_delete_issues: Supprimer les demandes
416 416 permission_manage_public_queries: GΓ©rer les requΓͺtes publiques
417 417 permission_save_queries: Sauvegarder les requΓͺtes
418 418 permission_view_gantt: Voir le gantt
419 419 permission_view_calendar: Voir le calendrier
420 420 permission_view_issue_watchers: Voir la liste des observateurs
421 421 permission_add_issue_watchers: Ajouter des observateurs
422 422 permission_delete_issue_watchers: Supprimer des observateurs
423 423 permission_log_time: Saisir le temps passΓ©
424 424 permission_view_time_entries: Voir le temps passΓ©
425 425 permission_edit_time_entries: Modifier les temps passΓ©s
426 426 permission_edit_own_time_entries: Modifier son propre temps passΓ©
427 427 permission_manage_news: GΓ©rer les annonces
428 428 permission_comment_news: Commenter les annonces
429 429 permission_manage_documents: GΓ©rer les documents
430 430 permission_view_documents: Voir les documents
431 431 permission_manage_files: GΓ©rer les fichiers
432 432 permission_view_files: Voir les fichiers
433 433 permission_manage_wiki: GΓ©rer le wiki
434 434 permission_rename_wiki_pages: Renommer les pages
435 435 permission_delete_wiki_pages: Supprimer les pages
436 436 permission_view_wiki_pages: Voir le wiki
437 437 permission_view_wiki_edits: "Voir l'historique des modifications"
438 438 permission_edit_wiki_pages: Modifier les pages
439 439 permission_delete_wiki_pages_attachments: Supprimer les fichiers joints
440 440 permission_protect_wiki_pages: ProtΓ©ger les pages
441 441 permission_manage_repository: GΓ©rer le dΓ©pΓ΄t de sources
442 442 permission_browse_repository: Parcourir les sources
443 443 permission_view_changesets: Voir les rΓ©visions
444 444 permission_commit_access: Droit de commit
445 445 permission_manage_boards: GΓ©rer les forums
446 446 permission_view_messages: Voir les messages
447 447 permission_add_messages: Poster un message
448 448 permission_edit_messages: Modifier les messages
449 449 permission_edit_own_messages: Modifier ses propres messages
450 450 permission_delete_messages: Supprimer les messages
451 451 permission_delete_own_messages: Supprimer ses propres messages
452 452 permission_export_wiki_pages: Exporter les pages
453 453 permission_manage_project_activities: GΓ©rer les activitΓ©s
454 454 permission_manage_subtasks: GΓ©rer les sous-tΓ’ches
455 455 permission_manage_related_issues: GΓ©rer les demandes associΓ©es
456 456
457 457 project_module_issue_tracking: Suivi des demandes
458 458 project_module_time_tracking: Suivi du temps passΓ©
459 459 project_module_news: Publication d'annonces
460 460 project_module_documents: Publication de documents
461 461 project_module_files: Publication de fichiers
462 462 project_module_wiki: Wiki
463 463 project_module_repository: DΓ©pΓ΄t de sources
464 464 project_module_boards: Forums de discussion
465 465
466 466 label_user: Utilisateur
467 467 label_user_plural: Utilisateurs
468 468 label_user_new: Nouvel utilisateur
469 469 label_user_anonymous: Anonyme
470 470 label_project: Projet
471 471 label_project_new: Nouveau projet
472 472 label_project_plural: Projets
473 473 label_x_projects:
474 474 zero: aucun projet
475 475 one: un projet
476 476 other: "%{count} projets"
477 477 label_project_all: Tous les projets
478 478 label_project_latest: Derniers projets
479 479 label_issue: Demande
480 480 label_issue_new: Nouvelle demande
481 481 label_issue_plural: Demandes
482 482 label_issue_view_all: Voir toutes les demandes
483 483 label_issue_added: Demande ajoutΓ©e
484 484 label_issue_updated: Demande mise Γ  jour
485 485 label_issue_note_added: Note ajoutΓ©e
486 486 label_issue_status_updated: Statut changΓ©
487 487 label_issue_priority_updated: PrioritΓ© changΓ©e
488 488 label_issues_by: "Demandes par %{value}"
489 489 label_document: Document
490 490 label_document_new: Nouveau document
491 491 label_document_plural: Documents
492 492 label_document_added: Document ajoutΓ©
493 493 label_role: RΓ΄le
494 494 label_role_plural: RΓ΄les
495 495 label_role_new: Nouveau rΓ΄le
496 496 label_role_and_permissions: RΓ΄les et permissions
497 497 label_role_anonymous: Anonyme
498 498 label_role_non_member: Non membre
499 499 label_member: Membre
500 500 label_member_new: Nouveau membre
501 501 label_member_plural: Membres
502 502 label_tracker: Tracker
503 503 label_tracker_plural: Trackers
504 504 label_tracker_new: Nouveau tracker
505 505 label_workflow: Workflow
506 506 label_issue_status: Statut de demandes
507 507 label_issue_status_plural: Statuts de demandes
508 508 label_issue_status_new: Nouveau statut
509 509 label_issue_category: CatΓ©gorie de demandes
510 510 label_issue_category_plural: CatΓ©gories de demandes
511 511 label_issue_category_new: Nouvelle catΓ©gorie
512 512 label_custom_field: Champ personnalisΓ©
513 513 label_custom_field_plural: Champs personnalisΓ©s
514 514 label_custom_field_new: Nouveau champ personnalisΓ©
515 515 label_enumerations: Listes de valeurs
516 516 label_enumeration_new: Nouvelle valeur
517 517 label_information: Information
518 518 label_information_plural: Informations
519 519 label_please_login: Identification
520 520 label_register: S'enregistrer
521 521 label_login_with_open_id_option: S'authentifier avec OpenID
522 522 label_password_lost: Mot de passe perdu
523 523 label_home: Accueil
524 524 label_my_page: Ma page
525 525 label_my_account: Mon compte
526 526 label_my_projects: Mes projets
527 527 label_my_page_block: Blocs disponibles
528 528 label_administration: Administration
529 529 label_login: Connexion
530 530 label_logout: DΓ©connexion
531 531 label_help: Aide
532 532 label_reported_issues: "Demandes soumises "
533 533 label_assigned_to_me_issues: Demandes qui me sont assignΓ©es
534 534 label_last_login: "Dernière connexion "
535 535 label_registered_on: "Inscrit le "
536 536 label_activity: ActivitΓ©
537 537 label_overall_activity: ActivitΓ© globale
538 538 label_user_activity: "ActivitΓ© de %{value}"
539 539 label_new: Nouveau
540 540 label_logged_as: ConnectΓ© en tant que
541 541 label_environment: Environnement
542 542 label_authentication: Authentification
543 543 label_auth_source: Mode d'authentification
544 544 label_auth_source_new: Nouveau mode d'authentification
545 545 label_auth_source_plural: Modes d'authentification
546 546 label_subproject_plural: Sous-projets
547 547 label_subproject_new: Nouveau sous-projet
548 548 label_and_its_subprojects: "%{value} et ses sous-projets"
549 549 label_min_max_length: Longueurs mini - maxi
550 550 label_list: Liste
551 551 label_date: Date
552 552 label_integer: Entier
553 553 label_float: Nombre dΓ©cimal
554 554 label_boolean: BoolΓ©en
555 555 label_string: Texte
556 556 label_text: Texte long
557 557 label_attribute: Attribut
558 558 label_attribute_plural: Attributs
559 559 label_download: "%{count} tΓ©lΓ©chargement"
560 560 label_download_plural: "%{count} tΓ©lΓ©chargements"
561 561 label_no_data: Aucune donnΓ©e Γ  afficher
562 562 label_change_status: Changer le statut
563 563 label_history: Historique
564 564 label_attachment: Fichier
565 565 label_attachment_new: Nouveau fichier
566 566 label_attachment_delete: Supprimer le fichier
567 567 label_attachment_plural: Fichiers
568 568 label_file_added: Fichier ajoutΓ©
569 569 label_report: Rapport
570 570 label_report_plural: Rapports
571 571 label_news: Annonce
572 572 label_news_new: Nouvelle annonce
573 573 label_news_plural: Annonces
574 574 label_news_latest: Dernières annonces
575 575 label_news_view_all: Voir toutes les annonces
576 576 label_news_added: Annonce ajoutΓ©e
577 577 label_news_comment_added: Commentaire ajoutΓ© Γ  une annonce
578 578 label_settings: Configuration
579 579 label_overview: AperΓ§u
580 580 label_version: Version
581 581 label_version_new: Nouvelle version
582 582 label_version_plural: Versions
583 583 label_confirmation: Confirmation
584 584 label_export_to: 'Formats disponibles :'
585 585 label_read: Lire...
586 586 label_public_projects: Projets publics
587 587 label_open_issues: ouvert
588 588 label_open_issues_plural: ouverts
589 589 label_closed_issues: fermΓ©
590 590 label_closed_issues_plural: fermΓ©s
591 591 label_x_open_issues_abbr_on_total:
592 592 zero: 0 ouverte sur %{total}
593 593 one: 1 ouverte sur %{total}
594 594 other: "%{count} ouvertes sur %{total}"
595 595 label_x_open_issues_abbr:
596 596 zero: 0 ouverte
597 597 one: 1 ouverte
598 598 other: "%{count} ouvertes"
599 599 label_x_closed_issues_abbr:
600 600 zero: 0 fermΓ©e
601 601 one: 1 fermΓ©e
602 602 other: "%{count} fermΓ©es"
603 603 label_x_issues:
604 604 zero: 0 demande
605 605 one: 1 demande
606 606 other: "%{count} demandes"
607 607 label_total: Total
608 608 label_permissions: Permissions
609 609 label_current_status: Statut actuel
610 610 label_new_statuses_allowed: Nouveaux statuts autorisΓ©s
611 611 label_all: tous
612 612 label_none: aucun
613 613 label_nobody: personne
614 614 label_next: Suivant
615 615 label_previous: PrΓ©cΓ©dent
616 616 label_used_by: UtilisΓ© par
617 617 label_details: DΓ©tails
618 618 label_add_note: Ajouter une note
619 619 label_per_page: Par page
620 620 label_calendar: Calendrier
621 621 label_months_from: mois depuis
622 622 label_gantt: Gantt
623 623 label_internal: Interne
624 624 label_last_changes: "%{count} derniers changements"
625 625 label_change_view_all: Voir tous les changements
626 626 label_personalize_page: Personnaliser cette page
627 627 label_comment: Commentaire
628 628 label_comment_plural: Commentaires
629 629 label_x_comments:
630 630 zero: aucun commentaire
631 631 one: un commentaire
632 632 other: "%{count} commentaires"
633 633 label_comment_add: Ajouter un commentaire
634 634 label_comment_added: Commentaire ajoutΓ©
635 635 label_comment_delete: Supprimer les commentaires
636 636 label_query: Rapport personnalisΓ©
637 637 label_query_plural: Rapports personnalisΓ©s
638 638 label_query_new: Nouveau rapport
639 639 label_my_queries: Mes rapports personnalisΓ©s
640 640 label_filter_add: "Ajouter le filtre "
641 641 label_filter_plural: Filtres
642 642 label_equals: Γ©gal
643 643 label_not_equals: diffΓ©rent
644 644 label_in_less_than: dans moins de
645 645 label_in_more_than: dans plus de
646 646 label_in: dans
647 647 label_today: aujourd'hui
648 648 label_all_time: toute la pΓ©riode
649 649 label_yesterday: hier
650 650 label_this_week: cette semaine
651 651 label_last_week: la semaine dernière
652 652 label_last_n_days: "les %{count} derniers jours"
653 653 label_this_month: ce mois-ci
654 654 label_last_month: le mois dernier
655 655 label_this_year: cette annΓ©e
656 656 label_date_range: PΓ©riode
657 657 label_less_than_ago: il y a moins de
658 658 label_more_than_ago: il y a plus de
659 659 label_ago: il y a
660 660 label_contains: contient
661 661 label_not_contains: ne contient pas
662 662 label_day_plural: jours
663 663 label_repository: DΓ©pΓ΄t
664 664 label_repository_new: Nouveau dΓ©pΓ΄t
665 665 label_repository_plural: DΓ©pΓ΄ts
666 666 label_browse: Parcourir
667 667 label_modification: "%{count} modification"
668 668 label_modification_plural: "%{count} modifications"
669 669 label_revision: "RΓ©vision "
670 670 label_revision_plural: RΓ©visions
671 671 label_associated_revisions: RΓ©visions associΓ©es
672 672 label_added: ajoutΓ©
673 673 label_modified: modifiΓ©
674 674 label_copied: copiΓ©
675 675 label_renamed: renommΓ©
676 676 label_deleted: supprimΓ©
677 677 label_latest_revision: Dernière révision
678 678 label_latest_revision_plural: Dernières révisions
679 679 label_view_revisions: Voir les rΓ©visions
680 680 label_max_size: Taille maximale
681 681 label_sort_highest: Remonter en premier
682 682 label_sort_higher: Remonter
683 683 label_sort_lower: Descendre
684 684 label_sort_lowest: Descendre en dernier
685 685 label_roadmap: Roadmap
686 686 label_roadmap_due_in: "Γ‰chΓ©ance dans %{value}"
687 687 label_roadmap_overdue: "En retard de %{value}"
688 688 label_roadmap_no_issues: Aucune demande pour cette version
689 689 label_search: "Recherche "
690 690 label_result_plural: RΓ©sultats
691 691 label_all_words: Tous les mots
692 692 label_wiki: Wiki
693 693 label_wiki_edit: RΓ©vision wiki
694 694 label_wiki_edit_plural: RΓ©visions wiki
695 695 label_wiki_page: Page wiki
696 696 label_wiki_page_plural: Pages wiki
697 697 label_index_by_title: Index par titre
698 698 label_index_by_date: Index par date
699 699 label_current_version: Version actuelle
700 700 label_preview: PrΓ©visualisation
701 701 label_feed_plural: Flux RSS
702 702 label_changes_details: DΓ©tails de tous les changements
703 703 label_issue_tracking: Suivi des demandes
704 704 label_spent_time: Temps passΓ©
705 705 label_f_hour: "%{value} heure"
706 706 label_f_hour_plural: "%{value} heures"
707 707 label_time_tracking: Suivi du temps
708 708 label_change_plural: Changements
709 709 label_statistics: Statistiques
710 710 label_commits_per_month: Commits par mois
711 711 label_commits_per_author: Commits par auteur
712 712 label_view_diff: Voir les diffΓ©rences
713 713 label_diff_inline: en ligne
714 714 label_diff_side_by_side: cΓ΄te Γ  cΓ΄te
715 715 label_options: Options
716 716 label_copy_workflow_from: Copier le workflow de
717 717 label_permissions_report: Synthèse des permissions
718 718 label_watched_issues: Demandes surveillΓ©es
719 719 label_related_issues: Demandes liΓ©es
720 720 label_applied_status: Statut appliquΓ©
721 721 label_loading: Chargement...
722 722 label_relation_new: Nouvelle relation
723 723 label_relation_delete: Supprimer la relation
724 724 label_relates_to: liΓ© Γ 
725 725 label_duplicates: duplique
726 726 label_duplicated_by: dupliquΓ© par
727 727 label_blocks: bloque
728 728 label_blocked_by: bloquΓ© par
729 729 label_precedes: précède
730 730 label_follows: suit
731 label_copied_to: copiΓ© vers
732 label_copied_from: copiΓ© depuis
731 733 label_end_to_start: fin Γ  dΓ©but
732 734 label_end_to_end: fin Γ  fin
733 735 label_start_to_start: dΓ©but Γ  dΓ©but
734 736 label_start_to_end: dΓ©but Γ  fin
735 737 label_stay_logged_in: Rester connectΓ©
736 738 label_disabled: dΓ©sactivΓ©
737 739 label_show_completed_versions: Voir les versions passΓ©es
738 740 label_me: moi
739 741 label_board: Forum
740 742 label_board_new: Nouveau forum
741 743 label_board_plural: Forums
742 744 label_topic_plural: Discussions
743 745 label_message_plural: Messages
744 746 label_message_last: Dernier message
745 747 label_message_new: Nouveau message
746 748 label_message_posted: Message ajoutΓ©
747 749 label_reply_plural: RΓ©ponses
748 750 label_send_information: Envoyer les informations Γ  l'utilisateur
749 751 label_year: AnnΓ©e
750 752 label_month: Mois
751 753 label_week: Semaine
752 754 label_date_from: Du
753 755 label_date_to: Au
754 756 label_language_based: BasΓ© sur la langue de l'utilisateur
755 757 label_sort_by: "Trier par %{value}"
756 758 label_send_test_email: Envoyer un email de test
757 759 label_feeds_access_key_created_on: "Clé d'accès RSS créée il y a %{value}"
758 760 label_module_plural: Modules
759 761 label_added_time_by: "AjoutΓ© par %{author} il y a %{age}"
760 762 label_updated_time_by: "Mis Γ  jour par %{author} il y a %{age}"
761 763 label_updated_time: "Mis Γ  jour il y a %{value}"
762 764 label_jump_to_a_project: Aller Γ  un projet...
763 765 label_file_plural: Fichiers
764 766 label_changeset_plural: RΓ©visions
765 767 label_default_columns: Colonnes par dΓ©faut
766 768 label_no_change_option: (Pas de changement)
767 769 label_bulk_edit_selected_issues: Modifier les demandes sΓ©lectionnΓ©es
768 770 label_theme: Thème
769 771 label_default: DΓ©faut
770 772 label_search_titles_only: Uniquement dans les titres
771 773 label_user_mail_option_all: "Pour tous les Γ©vΓ©nements de tous mes projets"
772 774 label_user_mail_option_selected: "Pour tous les Γ©vΓ©nements des projets sΓ©lectionnΓ©s..."
773 775 label_user_mail_no_self_notified: "Je ne veux pas Γͺtre notifiΓ© des changements que j'effectue"
774 776 label_registration_activation_by_email: activation du compte par email
775 777 label_registration_manual_activation: activation manuelle du compte
776 778 label_registration_automatic_activation: activation automatique du compte
777 779 label_display_per_page: "Par page : %{value}"
778 780 label_age: Γ‚ge
779 781 label_change_properties: Changer les propriΓ©tΓ©s
780 782 label_general: GΓ©nΓ©ral
781 783 label_more: Plus
782 784 label_scm: SCM
783 785 label_plugins: Plugins
784 786 label_ldap_authentication: Authentification LDAP
785 787 label_downloads_abbr: D/L
786 788 label_optional_description: Description facultative
787 789 label_add_another_file: Ajouter un autre fichier
788 790 label_preferences: PrΓ©fΓ©rences
789 791 label_chronological_order: Dans l'ordre chronologique
790 792 label_reverse_chronological_order: Dans l'ordre chronologique inverse
791 793 label_planning: Planning
792 794 label_incoming_emails: Emails entrants
793 795 label_generate_key: GΓ©nΓ©rer une clΓ©
794 796 label_issue_watchers: Observateurs
795 797 label_example: Exemple
796 798 label_display: Affichage
797 799 label_sort: Tri
798 800 label_ascending: Croissant
799 801 label_descending: DΓ©croissant
800 802 label_date_from_to: Du %{start} au %{end}
801 803 label_wiki_content_added: Page wiki ajoutΓ©e
802 804 label_wiki_content_updated: Page wiki mise Γ  jour
803 805 label_group_plural: Groupes
804 806 label_group: Groupe
805 807 label_group_new: Nouveau groupe
806 808 label_time_entry_plural: Temps passΓ©
807 809 label_version_sharing_none: Non partagΓ©
808 810 label_version_sharing_descendants: Avec les sous-projets
809 811 label_version_sharing_hierarchy: Avec toute la hiΓ©rarchie
810 812 label_version_sharing_tree: Avec tout l'arbre
811 813 label_version_sharing_system: Avec tous les projets
812 814 label_copy_source: Source
813 815 label_copy_target: Cible
814 816 label_copy_same_as_target: Comme la cible
815 817 label_update_issue_done_ratios: Mettre Γ  jour l'avancement des demandes
816 818 label_display_used_statuses_only: N'afficher que les statuts utilisΓ©s dans ce tracker
817 819 label_api_access_key: Clé d'accès API
818 820 label_api_access_key_created_on: Clé d'accès API créée il y a %{value}
819 821 label_feeds_access_key: Clé d'accès RSS
820 822 label_missing_api_access_key: Clé d'accès API manquante
821 823 label_missing_feeds_access_key: Clé d'accès RSS manquante
822 824 label_close_versions: Fermer les versions terminΓ©es
823 825 label_revision_id: RΓ©vision %{value}
824 826 label_profile: Profil
825 827 label_subtask_plural: Sous-tΓ’ches
826 828 label_project_copy_notifications: Envoyer les notifications durant la copie du projet
827 829 label_principal_search: "Rechercher un utilisateur ou un groupe :"
828 830 label_user_search: "Rechercher un utilisateur :"
829 831 label_additional_workflow_transitions_for_author: Autorisations supplémentaires lorsque l'utilisateur a créé la demande
830 832 label_additional_workflow_transitions_for_assignee: Autorisations supplΓ©mentaires lorsque la demande est assignΓ©e Γ  l'utilisateur
831 833 label_issues_visibility_all: Toutes les demandes
832 834 label_issues_visibility_public: Toutes les demandes non privΓ©es
833 835 label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur
834 836 label_export_options: Options d'exportation %{export_format}
835 837 label_copy_attachments: Copier les fichiers
836 838 label_copy_subtasks: Copier les sous-tΓ’ches
837 839 label_item_position: "%{position} sur %{count}"
838 840 label_completed_versions: Versions passΓ©es
839 841 label_session_expiration: Expiration des sessions
840 842 label_show_closed_projects: Voir les projets fermΓ©s
841 843 label_status_transitions: Changements de statut
842 844 label_fields_permissions: Permissions sur les champs
843 845 label_readonly: Lecture
844 846 label_required: Obligatoire
845 847 label_attribute_of_project: "%{name} du projet"
846 848 label_attribute_of_author: "%{name} de l'auteur"
847 849 label_attribute_of_assigned_to: "%{name} de l'assignΓ©"
848 850 label_attribute_of_fixed_version: "%{name} de la version cible"
849 851
850 852 button_login: Connexion
851 853 button_submit: Soumettre
852 854 button_save: Sauvegarder
853 855 button_check_all: Tout cocher
854 856 button_uncheck_all: Tout dΓ©cocher
855 857 button_collapse_all: Plier tout
856 858 button_expand_all: DΓ©plier tout
857 859 button_delete: Supprimer
858 860 button_create: CrΓ©er
859 861 button_create_and_continue: CrΓ©er et continuer
860 862 button_test: Tester
861 863 button_edit: Modifier
862 864 button_add: Ajouter
863 865 button_change: Changer
864 866 button_apply: Appliquer
865 867 button_clear: Effacer
866 868 button_lock: Verrouiller
867 869 button_unlock: DΓ©verrouiller
868 870 button_download: TΓ©lΓ©charger
869 871 button_list: Lister
870 872 button_view: Voir
871 873 button_move: DΓ©placer
872 874 button_move_and_follow: DΓ©placer et suivre
873 875 button_back: Retour
874 876 button_cancel: Annuler
875 877 button_activate: Activer
876 878 button_sort: Trier
877 879 button_log_time: Saisir temps
878 880 button_rollback: Revenir Γ  cette version
879 881 button_watch: Surveiller
880 882 button_unwatch: Ne plus surveiller
881 883 button_reply: RΓ©pondre
882 884 button_archive: Archiver
883 885 button_unarchive: DΓ©sarchiver
884 886 button_reset: RΓ©initialiser
885 887 button_rename: Renommer
886 888 button_change_password: Changer de mot de passe
887 889 button_copy: Copier
888 890 button_copy_and_follow: Copier et suivre
889 891 button_annotate: Annoter
890 892 button_update: Mettre Γ  jour
891 893 button_configure: Configurer
892 894 button_quote: Citer
893 895 button_duplicate: Dupliquer
894 896 button_show: Afficher
895 897 button_edit_section: Modifier cette section
896 898 button_export: Exporter
897 899 button_delete_my_account: Supprimer mon compte
898 900 button_close: Fermer
899 901 button_reopen: RΓ©ouvrir
900 902
901 903 status_active: actif
902 904 status_registered: enregistrΓ©
903 905 status_locked: verrouillΓ©
904 906
905 907 project_status_active: actif
906 908 project_status_closed: fermΓ©
907 909 project_status_archived: archivΓ©
908 910
909 911 version_status_open: ouvert
910 912 version_status_locked: verrouillΓ©
911 913 version_status_closed: fermΓ©
912 914
913 915 text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e
914 916 text_regexp_info: ex. ^[A-Z0-9]+$
915 917 text_min_max_length_info: 0 pour aucune restriction
916 918 text_project_destroy_confirmation: Êtes-vous sûr de vouloir supprimer ce projet et toutes ses données ?
917 919 text_subprojects_destroy_warning: "Ses sous-projets : %{value} seront Γ©galement supprimΓ©s."
918 920 text_workflow_edit: SΓ©lectionner un tracker et un rΓ΄le pour Γ©diter le workflow
919 921 text_are_you_sure: Êtes-vous sûr ?
920 922 text_tip_issue_begin_day: tΓ’che commenΓ§ant ce jour
921 923 text_tip_issue_end_day: tΓ’che finissant ce jour
922 924 text_tip_issue_begin_end_day: tΓ’che commenΓ§ant et finissant ce jour
923 925 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Γ©.'
924 926 text_caracters_maximum: "%{count} caractères maximum."
925 927 text_caracters_minimum: "%{count} caractères minimum."
926 928 text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
927 929 text_tracker_no_workflow: Aucun worflow n'est dΓ©fini pour ce tracker
928 930 text_unallowed_characters: Caractères non autorisés
929 931 text_comma_separated: Plusieurs valeurs possibles (sΓ©parΓ©es par des virgules).
930 932 text_line_separated: Plusieurs valeurs possibles (une valeur par ligne).
931 933 text_issues_ref_in_commit_messages: RΓ©fΓ©rencement et rΓ©solution des demandes dans les commentaires de commits
932 934 text_issue_added: "La demande %{id} a Γ©tΓ© soumise par %{author}."
933 935 text_issue_updated: "La demande %{id} a Γ©tΓ© mise Γ  jour par %{author}."
934 936 text_wiki_destroy_confirmation: Etes-vous sΓ»r de vouloir supprimer ce wiki et tout son contenu ?
935 937 text_issue_category_destroy_question: "%{count} demandes sont affectΓ©es Γ  cette catΓ©gorie. Que voulez-vous faire ?"
936 938 text_issue_category_destroy_assignments: N'affecter les demandes Γ  aucune autre catΓ©gorie
937 939 text_issue_category_reassign_to: RΓ©affecter les demandes Γ  cette catΓ©gorie
938 940 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)."
939 941 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Γ©."
940 942 text_load_default_configuration: Charger le paramΓ©trage par dΓ©faut
941 943 text_status_changed_by_changeset: "AppliquΓ© par commit %{value}."
942 944 text_time_logged_by_changeset: "AppliquΓ© par commit %{value}"
943 945 text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
944 946 text_issues_destroy_descendants_confirmation: "Cela entrainera Γ©galement la suppression de %{count} sous-tΓ’che(s)."
945 947 text_select_project_modules: 'SΓ©lectionner les modules Γ  activer pour ce projet :'
946 948 text_default_administrator_account_changed: Compte administrateur par dΓ©faut changΓ©
947 949 text_file_repository_writable: RΓ©pertoire de stockage des fichiers accessible en Γ©criture
948 950 text_plugin_assets_writable: RΓ©pertoire public des plugins accessible en Γ©criture
949 951 text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
950 952 text_destroy_time_entries_question: "%{hours} heures ont Γ©tΓ© enregistrΓ©es sur les demandes Γ  supprimer. Que voulez-vous faire ?"
951 953 text_destroy_time_entries: Supprimer les heures
952 954 text_assign_time_entries_to_project: Reporter les heures sur le projet
953 955 text_reassign_time_entries: 'Reporter les heures sur cette demande:'
954 956 text_user_wrote: "%{value} a Γ©crit :"
955 957 text_enumeration_destroy_question: "Cette valeur est affectΓ©e Γ  %{count} objets."
956 958 text_enumeration_category_reassign_to: 'RΓ©affecter les objets Γ  cette valeur:'
957 959 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."
958 960 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."
959 961 text_diff_truncated: '... Ce diffΓ©rentiel a Γ©tΓ© tronquΓ© car il excΓ¨de la taille maximale pouvant Γͺtre affichΓ©e.'
960 962 text_custom_field_possible_values_info: 'Une ligne par valeur'
961 963 text_wiki_page_destroy_question: "Cette page possède %{descendants} sous-page(s) et descendante(s). Que voulez-vous faire ?"
962 964 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
963 965 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
964 966 text_wiki_page_reassign_children: "RΓ©affecter les sous-pages Γ  cette page"
965 967 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 ?"
966 968 text_warn_on_leaving_unsaved: "Cette page contient du texte non sauvegardΓ© qui sera perdu si vous quittez la page."
967 969 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)"
968 970 text_issue_conflict_resolution_add_notes: "Ajouter mes notes et ignorer mes autres changements"
969 971 text_issue_conflict_resolution_cancel: "Annuler ma mise Γ  jour et rΓ©afficher %{link}"
970 972 text_account_destroy_confirmation: "Êtes-vous sûr de vouloir continuer ?\nVotre compte sera définitivement supprimé, sans aucune possibilité de le réactiver."
971 973 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."
972 974 text_project_closed: Ce projet est fermΓ© et accessible en lecture seule.
973 975
974 976 default_role_manager: "Manager "
975 977 default_role_developer: "DΓ©veloppeur "
976 978 default_role_reporter: "Rapporteur "
977 979 default_tracker_bug: Anomalie
978 980 default_tracker_feature: Evolution
979 981 default_tracker_support: Assistance
980 982 default_issue_status_new: Nouveau
981 983 default_issue_status_in_progress: En cours
982 984 default_issue_status_resolved: RΓ©solu
983 985 default_issue_status_feedback: Commentaire
984 986 default_issue_status_closed: FermΓ©
985 987 default_issue_status_rejected: RejetΓ©
986 988 default_doc_category_user: Documentation utilisateur
987 989 default_doc_category_tech: Documentation technique
988 990 default_priority_low: Bas
989 991 default_priority_normal: Normal
990 992 default_priority_high: Haut
991 993 default_priority_urgent: Urgent
992 994 default_priority_immediate: ImmΓ©diat
993 995 default_activity_design: Conception
994 996 default_activity_development: DΓ©veloppement
995 997
996 998 enumeration_issue_priorities: PrioritΓ©s des demandes
997 999 enumeration_doc_categories: CatΓ©gories des documents
998 1000 enumeration_activities: ActivitΓ©s (suivi du temps)
999 1001 label_greater_or_equal: ">="
1000 1002 label_less_or_equal: "<="
1001 1003 label_between: entre
1002 1004 label_view_all_revisions: Voir toutes les rΓ©visions
1003 1005 label_tag: Tag
1004 1006 label_branch: Branche
1005 1007 error_no_tracker_in_project: "Aucun tracker n'est associΓ© Γ  ce projet. VΓ©rifier la configuration du projet."
1006 1008 error_no_default_issue_status: "Aucun statut de demande n'est dΓ©fini par dΓ©faut. VΓ©rifier votre configuration (Administration -> Statuts de demandes)."
1007 1009 text_journal_changed: "%{label} changΓ© de %{old} Γ  %{new}"
1008 1010 text_journal_changed_no_detail: "%{label} mis Γ  jour"
1009 1011 text_journal_set_to: "%{label} mis Γ  %{value}"
1010 1012 text_journal_deleted: "%{label} %{old} supprimΓ©"
1011 1013 text_journal_added: "%{label} %{value} ajoutΓ©"
1012 1014 enumeration_system_activity: Activité système
1013 1015 label_board_sticky: Sticky
1014 1016 label_board_locked: VerrouillΓ©
1015 1017 error_unable_delete_issue_status: Impossible de supprimer le statut de demande
1016 1018 error_can_not_delete_custom_field: Impossible de supprimer le champ personnalisΓ©
1017 1019 error_unable_to_connect: Connexion impossible (%{value})
1018 1020 error_can_not_remove_role: Ce rΓ΄le est utilisΓ© et ne peut pas Γͺtre supprimΓ©.
1019 1021 error_can_not_delete_tracker: Ce tracker contient des demandes et ne peut pas Γͺtre supprimΓ©.
1020 1022 field_principal: Principal
1021 1023 notice_failed_to_save_members: "Erreur lors de la sauvegarde des membres: %{errors}."
1022 1024 text_zoom_out: Zoom arrière
1023 1025 text_zoom_in: Zoom avant
1024 1026 notice_unable_delete_time_entry: Impossible de supprimer le temps passΓ©.
1025 1027 label_overall_spent_time: Temps passΓ© global
1026 1028 field_time_entries: Temps passΓ©
1027 1029 project_module_gantt: Gantt
1028 1030 project_module_calendar: Calendrier
1029 1031 button_edit_associated_wikipage: "Modifier la page wiki associΓ©e: %{page_title}"
1030 1032 text_are_you_sure_with_children: Supprimer la demande et toutes ses sous-demandes ?
1031 1033 field_text: Champ texte
1032 1034 label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
1033 1035 setting_default_notification_option: Option de notification par dΓ©faut
1034 1036 label_user_mail_option_only_my_events: Seulement pour ce que je surveille
1035 1037 label_user_mail_option_only_assigned: Seulement pour ce qui m'est assignΓ©
1036 1038 label_user_mail_option_none: Aucune notification
1037 1039 field_member_of_group: Groupe de l'assignΓ©
1038 1040 field_assigned_to_role: RΓ΄le de l'assignΓ©
1039 1041 setting_emails_header: En-tΓͺte des emails
1040 1042 label_bulk_edit_selected_time_entries: Modifier les temps passΓ©s sΓ©lectionnΓ©s
1041 1043 text_time_entries_destroy_confirmation: "Etes-vous sΓ»r de vouloir supprimer les temps passΓ©s sΓ©lectionnΓ©s ?"
1042 1044 field_scm_path_encoding: Encodage des chemins
1043 1045 text_scm_path_encoding_note: "DΓ©faut : UTF-8"
1044 1046 field_path_to_repository: Chemin du dΓ©pΓ΄t
1045 1047 field_root_directory: RΓ©pertoire racine
1046 1048 field_cvs_module: Module
1047 1049 field_cvsroot: CVSROOT
1048 1050 text_mercurial_repository_note: "DΓ©pΓ΄t local (exemples : /hgrepo, c:\\hgrepo)"
1049 1051 text_scm_command: Commande
1050 1052 text_scm_command_version: Version
1051 1053 label_git_report_last_commit: Afficher le dernier commit des fichiers et rΓ©pertoires
1052 1054 text_scm_config: Vous pouvez configurer les commandes des SCM dans config/configuration.yml. Redémarrer l'application après modification.
1053 1055 text_scm_command_not_available: Ce SCM n'est pas disponible. Vérifier les paramètres dans la section administration.
1054 1056 label_diff: diff
1055 1057 text_git_repository_note: Repository is bare and local (e.g. /gitrepo, c:\gitrepo)
1056 1058 description_query_sort_criteria_direction: Ordre de tri
1057 1059 description_project_scope: Périmètre de recherche
1058 1060 description_filter: Filtre
1059 1061 description_user_mail_notification: Option de notification
1060 1062 description_date_from: Date de dΓ©but
1061 1063 description_message_content: Contenu du message
1062 1064 description_available_columns: Colonnes disponibles
1063 1065 description_all_columns: Toutes les colonnes
1064 1066 description_date_range_interval: Choisir une pΓ©riode
1065 1067 description_issue_category_reassign: Choisir une catΓ©gorie
1066 1068 description_search: Champ de recherche
1067 1069 description_notes: Notes
1068 1070 description_date_range_list: Choisir une pΓ©riode prΓ©dΓ©finie
1069 1071 description_choose_project: Projets
1070 1072 description_date_to: Date de fin
1071 1073 description_query_sort_criteria_attribute: Critère de tri
1072 1074 description_wiki_subpages_reassign: Choisir une nouvelle page parent
1073 1075 description_selected_columns: Colonnes sΓ©lectionnΓ©es
1074 1076 label_parent_revision: Parent
1075 1077 label_child_revision: Enfant
1076 1078 error_scm_annotate_big_text_file: Cette entrΓ©e ne peut pas Γͺtre annotΓ©e car elle excΓ¨de la taille maximale.
1077 1079 setting_repositories_encodings: Encodages des fichiers et des dΓ©pΓ΄ts
1078 1080 label_search_for_watchers: Rechercher des observateurs
1079 1081 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 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,1579 +1,1592
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 def test_copy_should_add_relation_with_copied_issue
640 copied = Issue.find(1)
641 issue = Issue.new.copy_from(copied)
642 assert issue.save
643 issue.reload
644
645 assert_equal 1, issue.relations.size
646 relation = issue.relations.first
647 assert_equal 'copied_to', relation.relation_type
648 assert_equal copied, relation.issue_from
649 assert_equal issue, relation.issue_to
650 end
651
639 652 def test_copy_should_copy_subtasks
640 653 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
641 654
642 655 copy = issue.reload.copy
643 656 copy.author = User.find(7)
644 657 assert_difference 'Issue.count', 1+issue.descendants.count do
645 658 assert copy.save
646 659 end
647 660 copy.reload
648 661 assert_equal %w(Child1 Child2), copy.children.map(&:subject).sort
649 662 child_copy = copy.children.detect {|c| c.subject == 'Child1'}
650 663 assert_equal %w(Child11), child_copy.children.map(&:subject).sort
651 664 assert_equal copy.author, child_copy.author
652 665 end
653 666
654 667 def test_copy_should_copy_subtasks_to_target_project
655 668 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
656 669
657 670 copy = issue.copy(:project_id => 3)
658 671 assert_difference 'Issue.count', 1+issue.descendants.count do
659 672 assert copy.save
660 673 end
661 674 assert_equal [3], copy.reload.descendants.map(&:project_id).uniq
662 675 end
663 676
664 677 def test_copy_should_not_copy_subtasks_twice_when_saving_twice
665 678 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
666 679
667 680 copy = issue.reload.copy
668 681 assert_difference 'Issue.count', 1+issue.descendants.count do
669 682 assert copy.save
670 683 assert copy.save
671 684 end
672 685 end
673 686
674 687 def test_should_not_call_after_project_change_on_creation
675 688 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, :subject => 'Test', :author_id => 1)
676 689 issue.expects(:after_project_change).never
677 690 issue.save!
678 691 end
679 692
680 693 def test_should_not_call_after_project_change_on_update
681 694 issue = Issue.find(1)
682 695 issue.project = Project.find(1)
683 696 issue.subject = 'No project change'
684 697 issue.expects(:after_project_change).never
685 698 issue.save!
686 699 end
687 700
688 701 def test_should_call_after_project_change_on_project_change
689 702 issue = Issue.find(1)
690 703 issue.project = Project.find(2)
691 704 issue.expects(:after_project_change).once
692 705 issue.save!
693 706 end
694 707
695 708 def test_adding_journal_should_update_timestamp
696 709 issue = Issue.find(1)
697 710 updated_on_was = issue.updated_on
698 711
699 712 issue.init_journal(User.first, "Adding notes")
700 713 assert_difference 'Journal.count' do
701 714 assert issue.save
702 715 end
703 716 issue.reload
704 717
705 718 assert_not_equal updated_on_was, issue.updated_on
706 719 end
707 720
708 721 def test_should_close_duplicates
709 722 # Create 3 issues
710 723 project = Project.find(1)
711 724 issue1 = Issue.generate_for_project!(project)
712 725 issue2 = Issue.generate_for_project!(project)
713 726 issue3 = Issue.generate_for_project!(project)
714 727
715 728 # 2 is a dupe of 1
716 729 IssueRelation.create!(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
717 730 # And 3 is a dupe of 2
718 731 IssueRelation.create!(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
719 732 # And 3 is a dupe of 1 (circular duplicates)
720 733 IssueRelation.create!(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
721 734
722 735 assert issue1.reload.duplicates.include?(issue2)
723 736
724 737 # Closing issue 1
725 738 issue1.init_journal(User.find(:first), "Closing issue1")
726 739 issue1.status = IssueStatus.find :first, :conditions => {:is_closed => true}
727 740 assert issue1.save
728 741 # 2 and 3 should be also closed
729 742 assert issue2.reload.closed?
730 743 assert issue3.reload.closed?
731 744 end
732 745
733 746 def test_should_not_close_duplicated_issue
734 747 project = Project.find(1)
735 748 issue1 = Issue.generate_for_project!(project)
736 749 issue2 = Issue.generate_for_project!(project)
737 750
738 751 # 2 is a dupe of 1
739 752 IssueRelation.create(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
740 753 # 2 is a dup of 1 but 1 is not a duplicate of 2
741 754 assert !issue2.reload.duplicates.include?(issue1)
742 755
743 756 # Closing issue 2
744 757 issue2.init_journal(User.find(:first), "Closing issue2")
745 758 issue2.status = IssueStatus.find :first, :conditions => {:is_closed => true}
746 759 assert issue2.save
747 760 # 1 should not be also closed
748 761 assert !issue1.reload.closed?
749 762 end
750 763
751 764 def test_assignable_versions
752 765 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
753 766 assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq
754 767 end
755 768
756 769 def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version
757 770 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue')
758 771 assert !issue.save
759 772 assert_not_nil issue.errors[:fixed_version_id]
760 773 end
761 774
762 775 def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version
763 776 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 2, :subject => 'New issue')
764 777 assert !issue.save
765 778 assert_not_nil issue.errors[:fixed_version_id]
766 779 end
767 780
768 781 def test_should_be_able_to_assign_a_new_issue_to_an_open_version
769 782 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 3, :subject => 'New issue')
770 783 assert issue.save
771 784 end
772 785
773 786 def test_should_be_able_to_update_an_issue_assigned_to_a_closed_version
774 787 issue = Issue.find(11)
775 788 assert_equal 'closed', issue.fixed_version.status
776 789 issue.subject = 'Subject changed'
777 790 assert issue.save
778 791 end
779 792
780 793 def test_should_not_be_able_to_reopen_an_issue_assigned_to_a_closed_version
781 794 issue = Issue.find(11)
782 795 issue.status_id = 1
783 796 assert !issue.save
784 797 assert_not_nil issue.errors[:base]
785 798 end
786 799
787 800 def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version
788 801 issue = Issue.find(11)
789 802 issue.status_id = 1
790 803 issue.fixed_version_id = 3
791 804 assert issue.save
792 805 end
793 806
794 807 def test_should_be_able_to_reopen_an_issue_assigned_to_a_locked_version
795 808 issue = Issue.find(12)
796 809 assert_equal 'locked', issue.fixed_version.status
797 810 issue.status_id = 1
798 811 assert issue.save
799 812 end
800 813
801 814 def test_should_not_be_able_to_keep_unshared_version_when_changing_project
802 815 issue = Issue.find(2)
803 816 assert_equal 2, issue.fixed_version_id
804 817 issue.project_id = 3
805 818 assert_nil issue.fixed_version_id
806 819 issue.fixed_version_id = 2
807 820 assert !issue.save
808 821 assert_include 'Target version is not included in the list', issue.errors.full_messages
809 822 end
810 823
811 824 def test_should_keep_shared_version_when_changing_project
812 825 Version.find(2).update_attribute :sharing, 'tree'
813 826
814 827 issue = Issue.find(2)
815 828 assert_equal 2, issue.fixed_version_id
816 829 issue.project_id = 3
817 830 assert_equal 2, issue.fixed_version_id
818 831 assert issue.save
819 832 end
820 833
821 834 def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled
822 835 assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
823 836 end
824 837
825 838 def test_allowed_target_projects_on_move_should_not_include_projects_with_issue_tracking_disabled
826 839 Project.find(2).disable_module! :issue_tracking
827 840 assert_not_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
828 841 end
829 842
830 843 def test_move_to_another_project_with_same_category
831 844 issue = Issue.find(1)
832 845 issue.project = Project.find(2)
833 846 assert issue.save
834 847 issue.reload
835 848 assert_equal 2, issue.project_id
836 849 # Category changes
837 850 assert_equal 4, issue.category_id
838 851 # Make sure time entries were move to the target project
839 852 assert_equal 2, issue.time_entries.first.project_id
840 853 end
841 854
842 855 def test_move_to_another_project_without_same_category
843 856 issue = Issue.find(2)
844 857 issue.project = Project.find(2)
845 858 assert issue.save
846 859 issue.reload
847 860 assert_equal 2, issue.project_id
848 861 # Category cleared
849 862 assert_nil issue.category_id
850 863 end
851 864
852 865 def test_move_to_another_project_should_clear_fixed_version_when_not_shared
853 866 issue = Issue.find(1)
854 867 issue.update_attribute(:fixed_version_id, 1)
855 868 issue.project = Project.find(2)
856 869 assert issue.save
857 870 issue.reload
858 871 assert_equal 2, issue.project_id
859 872 # Cleared fixed_version
860 873 assert_equal nil, issue.fixed_version
861 874 end
862 875
863 876 def test_move_to_another_project_should_keep_fixed_version_when_shared_with_the_target_project
864 877 issue = Issue.find(1)
865 878 issue.update_attribute(:fixed_version_id, 4)
866 879 issue.project = Project.find(5)
867 880 assert issue.save
868 881 issue.reload
869 882 assert_equal 5, issue.project_id
870 883 # Keep fixed_version
871 884 assert_equal 4, issue.fixed_version_id
872 885 end
873 886
874 887 def test_move_to_another_project_should_clear_fixed_version_when_not_shared_with_the_target_project
875 888 issue = Issue.find(1)
876 889 issue.update_attribute(:fixed_version_id, 1)
877 890 issue.project = Project.find(5)
878 891 assert issue.save
879 892 issue.reload
880 893 assert_equal 5, issue.project_id
881 894 # Cleared fixed_version
882 895 assert_equal nil, issue.fixed_version
883 896 end
884 897
885 898 def test_move_to_another_project_should_keep_fixed_version_when_shared_systemwide
886 899 issue = Issue.find(1)
887 900 issue.update_attribute(:fixed_version_id, 7)
888 901 issue.project = Project.find(2)
889 902 assert issue.save
890 903 issue.reload
891 904 assert_equal 2, issue.project_id
892 905 # Keep fixed_version
893 906 assert_equal 7, issue.fixed_version_id
894 907 end
895 908
896 909 def test_move_to_another_project_with_disabled_tracker
897 910 issue = Issue.find(1)
898 911 target = Project.find(2)
899 912 target.tracker_ids = [3]
900 913 target.save
901 914 issue.project = target
902 915 assert issue.save
903 916 issue.reload
904 917 assert_equal 2, issue.project_id
905 918 assert_equal 3, issue.tracker_id
906 919 end
907 920
908 921 def test_copy_to_the_same_project
909 922 issue = Issue.find(1)
910 923 copy = issue.copy
911 924 assert_difference 'Issue.count' do
912 925 copy.save!
913 926 end
914 927 assert_kind_of Issue, copy
915 928 assert_equal issue.project, copy.project
916 929 assert_equal "125", copy.custom_value_for(2).value
917 930 end
918 931
919 932 def test_copy_to_another_project_and_tracker
920 933 issue = Issue.find(1)
921 934 copy = issue.copy(:project_id => 3, :tracker_id => 2)
922 935 assert_difference 'Issue.count' do
923 936 copy.save!
924 937 end
925 938 copy.reload
926 939 assert_kind_of Issue, copy
927 940 assert_equal Project.find(3), copy.project
928 941 assert_equal Tracker.find(2), copy.tracker
929 942 # Custom field #2 is not associated with target tracker
930 943 assert_nil copy.custom_value_for(2)
931 944 end
932 945
933 946 context "#copy" do
934 947 setup do
935 948 @issue = Issue.find(1)
936 949 end
937 950
938 951 should "not create a journal" do
939 952 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
940 953 copy.save!
941 954 assert_equal 0, copy.reload.journals.size
942 955 end
943 956
944 957 should "allow assigned_to changes" do
945 958 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :assigned_to_id => 3)
946 959 assert_equal 3, copy.assigned_to_id
947 960 end
948 961
949 962 should "allow status changes" do
950 963 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :status_id => 2)
951 964 assert_equal 2, copy.status_id
952 965 end
953 966
954 967 should "allow start date changes" do
955 968 date = Date.today
956 969 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
957 970 assert_equal date, copy.start_date
958 971 end
959 972
960 973 should "allow due date changes" do
961 974 date = Date.today
962 975 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :due_date => date)
963 976 assert_equal date, copy.due_date
964 977 end
965 978
966 979 should "set current user as author" do
967 980 User.current = User.find(9)
968 981 copy = @issue.copy(:project_id => 3, :tracker_id => 2)
969 982 assert_equal User.current, copy.author
970 983 end
971 984
972 985 should "create a journal with notes" do
973 986 date = Date.today
974 987 notes = "Notes added when copying"
975 988 copy = @issue.copy(:project_id => 3, :tracker_id => 2, :start_date => date)
976 989 copy.init_journal(User.current, notes)
977 990 copy.save!
978 991
979 992 assert_equal 1, copy.journals.size
980 993 journal = copy.journals.first
981 994 assert_equal 0, journal.details.size
982 995 assert_equal notes, journal.notes
983 996 end
984 997 end
985 998
986 999 def test_recipients_should_include_previous_assignee
987 1000 user = User.find(3)
988 1001 user.members.update_all ["mail_notification = ?", false]
989 1002 user.update_attribute :mail_notification, 'only_assigned'
990 1003
991 1004 issue = Issue.find(2)
992 1005 issue.assigned_to = nil
993 1006 assert_include user.mail, issue.recipients
994 1007 issue.save!
995 1008 assert !issue.recipients.include?(user.mail)
996 1009 end
997 1010
998 1011 def test_recipients_should_not_include_users_that_cannot_view_the_issue
999 1012 issue = Issue.find(12)
1000 1013 assert issue.recipients.include?(issue.author.mail)
1001 1014 # copy the issue to a private project
1002 1015 copy = issue.copy(:project_id => 5, :tracker_id => 2)
1003 1016 # author is not a member of project anymore
1004 1017 assert !copy.recipients.include?(copy.author.mail)
1005 1018 end
1006 1019
1007 1020 def test_recipients_should_include_the_assigned_group_members
1008 1021 group_member = User.generate!
1009 1022 group = Group.generate!
1010 1023 group.users << group_member
1011 1024
1012 1025 issue = Issue.find(12)
1013 1026 issue.assigned_to = group
1014 1027 assert issue.recipients.include?(group_member.mail)
1015 1028 end
1016 1029
1017 1030 def test_watcher_recipients_should_not_include_users_that_cannot_view_the_issue
1018 1031 user = User.find(3)
1019 1032 issue = Issue.find(9)
1020 1033 Watcher.create!(:user => user, :watchable => issue)
1021 1034 assert issue.watched_by?(user)
1022 1035 assert !issue.watcher_recipients.include?(user.mail)
1023 1036 end
1024 1037
1025 1038 def test_issue_destroy
1026 1039 Issue.find(1).destroy
1027 1040 assert_nil Issue.find_by_id(1)
1028 1041 assert_nil TimeEntry.find_by_issue_id(1)
1029 1042 end
1030 1043
1031 1044 def test_destroying_a_deleted_issue_should_not_raise_an_error
1032 1045 issue = Issue.find(1)
1033 1046 Issue.find(1).destroy
1034 1047
1035 1048 assert_nothing_raised do
1036 1049 assert_no_difference 'Issue.count' do
1037 1050 issue.destroy
1038 1051 end
1039 1052 assert issue.destroyed?
1040 1053 end
1041 1054 end
1042 1055
1043 1056 def test_destroying_a_stale_issue_should_not_raise_an_error
1044 1057 issue = Issue.find(1)
1045 1058 Issue.find(1).update_attribute :subject, "Updated"
1046 1059
1047 1060 assert_nothing_raised do
1048 1061 assert_difference 'Issue.count', -1 do
1049 1062 issue.destroy
1050 1063 end
1051 1064 assert issue.destroyed?
1052 1065 end
1053 1066 end
1054 1067
1055 1068 def test_blocked
1056 1069 blocked_issue = Issue.find(9)
1057 1070 blocking_issue = Issue.find(10)
1058 1071
1059 1072 assert blocked_issue.blocked?
1060 1073 assert !blocking_issue.blocked?
1061 1074 end
1062 1075
1063 1076 def test_blocked_issues_dont_allow_closed_statuses
1064 1077 blocked_issue = Issue.find(9)
1065 1078
1066 1079 allowed_statuses = blocked_issue.new_statuses_allowed_to(users(:users_002))
1067 1080 assert !allowed_statuses.empty?
1068 1081 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1069 1082 assert closed_statuses.empty?
1070 1083 end
1071 1084
1072 1085 def test_unblocked_issues_allow_closed_statuses
1073 1086 blocking_issue = Issue.find(10)
1074 1087
1075 1088 allowed_statuses = blocking_issue.new_statuses_allowed_to(users(:users_002))
1076 1089 assert !allowed_statuses.empty?
1077 1090 closed_statuses = allowed_statuses.select {|st| st.is_closed?}
1078 1091 assert !closed_statuses.empty?
1079 1092 end
1080 1093
1081 1094 def test_rescheduling_an_issue_should_reschedule_following_issue
1082 1095 issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1083 1096 issue2 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
1084 1097 IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
1085 1098 assert_equal issue1.due_date + 1, issue2.reload.start_date
1086 1099
1087 1100 issue1.due_date = Date.today + 5
1088 1101 issue1.save!
1089 1102 assert_equal issue1.due_date + 1, issue2.reload.start_date
1090 1103 end
1091 1104
1092 1105 def test_rescheduling_a_stale_issue_should_not_raise_an_error
1093 1106 stale = Issue.find(1)
1094 1107 issue = Issue.find(1)
1095 1108 issue.subject = "Updated"
1096 1109 issue.save!
1097 1110
1098 1111 date = 10.days.from_now.to_date
1099 1112 assert_nothing_raised do
1100 1113 stale.reschedule_after(date)
1101 1114 end
1102 1115 assert_equal date, stale.reload.start_date
1103 1116 end
1104 1117
1105 1118 def test_overdue
1106 1119 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
1107 1120 assert !Issue.new(:due_date => Date.today).overdue?
1108 1121 assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
1109 1122 assert !Issue.new(:due_date => nil).overdue?
1110 1123 assert !Issue.new(:due_date => 1.day.ago.to_date, :status => IssueStatus.find(:first, :conditions => {:is_closed => true})).overdue?
1111 1124 end
1112 1125
1113 1126 context "#behind_schedule?" do
1114 1127 should "be false if the issue has no start_date" do
1115 1128 assert !Issue.new(:start_date => nil, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1116 1129 end
1117 1130
1118 1131 should "be false if the issue has no end_date" do
1119 1132 assert !Issue.new(:start_date => 1.day.from_now.to_date, :due_date => nil, :done_ratio => 0).behind_schedule?
1120 1133 end
1121 1134
1122 1135 should "be false if the issue has more done than it's calendar time" do
1123 1136 assert !Issue.new(:start_date => 50.days.ago.to_date, :due_date => 50.days.from_now.to_date, :done_ratio => 90).behind_schedule?
1124 1137 end
1125 1138
1126 1139 should "be true if the issue hasn't been started at all" do
1127 1140 assert Issue.new(:start_date => 1.day.ago.to_date, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1128 1141 end
1129 1142
1130 1143 should "be true if the issue has used more calendar time than it's done ratio" do
1131 1144 assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
1132 1145 end
1133 1146 end
1134 1147
1135 1148 context "#assignable_users" do
1136 1149 should "be Users" do
1137 1150 assert_kind_of User, Issue.find(1).assignable_users.first
1138 1151 end
1139 1152
1140 1153 should "include the issue author" do
1141 1154 project = Project.find(1)
1142 1155 non_project_member = User.generate!
1143 1156 issue = Issue.generate_for_project!(project, :author => non_project_member)
1144 1157
1145 1158 assert issue.assignable_users.include?(non_project_member)
1146 1159 end
1147 1160
1148 1161 should "include the current assignee" do
1149 1162 project = Project.find(1)
1150 1163 user = User.generate!
1151 1164 issue = Issue.generate_for_project!(project, :assigned_to => user)
1152 1165 user.lock!
1153 1166
1154 1167 assert Issue.find(issue.id).assignable_users.include?(user)
1155 1168 end
1156 1169
1157 1170 should "not show the issue author twice" do
1158 1171 assignable_user_ids = Issue.find(1).assignable_users.collect(&:id)
1159 1172 assert_equal 2, assignable_user_ids.length
1160 1173
1161 1174 assignable_user_ids.each do |user_id|
1162 1175 assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once"
1163 1176 end
1164 1177 end
1165 1178
1166 1179 context "with issue_group_assignment" do
1167 1180 should "include groups" do
1168 1181 issue = Issue.new(:project => Project.find(2))
1169 1182
1170 1183 with_settings :issue_group_assignment => '1' do
1171 1184 assert_equal %w(Group User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1172 1185 assert issue.assignable_users.include?(Group.find(11))
1173 1186 end
1174 1187 end
1175 1188 end
1176 1189
1177 1190 context "without issue_group_assignment" do
1178 1191 should "not include groups" do
1179 1192 issue = Issue.new(:project => Project.find(2))
1180 1193
1181 1194 with_settings :issue_group_assignment => '0' do
1182 1195 assert_equal %w(User), issue.assignable_users.map {|a| a.class.name}.uniq.sort
1183 1196 assert !issue.assignable_users.include?(Group.find(11))
1184 1197 end
1185 1198 end
1186 1199 end
1187 1200 end
1188 1201
1189 1202 def test_create_should_send_email_notification
1190 1203 ActionMailer::Base.deliveries.clear
1191 1204 issue = Issue.new(:project_id => 1, :tracker_id => 1,
1192 1205 :author_id => 3, :status_id => 1,
1193 1206 :priority => IssuePriority.all.first,
1194 1207 :subject => 'test_create', :estimated_hours => '1:30')
1195 1208
1196 1209 assert issue.save
1197 1210 assert_equal 1, ActionMailer::Base.deliveries.size
1198 1211 end
1199 1212
1200 1213 def test_stale_issue_should_not_send_email_notification
1201 1214 ActionMailer::Base.deliveries.clear
1202 1215 issue = Issue.find(1)
1203 1216 stale = Issue.find(1)
1204 1217
1205 1218 issue.init_journal(User.find(1))
1206 1219 issue.subject = 'Subjet update'
1207 1220 assert issue.save
1208 1221 assert_equal 1, ActionMailer::Base.deliveries.size
1209 1222 ActionMailer::Base.deliveries.clear
1210 1223
1211 1224 stale.init_journal(User.find(1))
1212 1225 stale.subject = 'Another subjet update'
1213 1226 assert_raise ActiveRecord::StaleObjectError do
1214 1227 stale.save
1215 1228 end
1216 1229 assert ActionMailer::Base.deliveries.empty?
1217 1230 end
1218 1231
1219 1232 def test_journalized_description
1220 1233 IssueCustomField.delete_all
1221 1234
1222 1235 i = Issue.first
1223 1236 old_description = i.description
1224 1237 new_description = "This is the new description"
1225 1238
1226 1239 i.init_journal(User.find(2))
1227 1240 i.description = new_description
1228 1241 assert_difference 'Journal.count', 1 do
1229 1242 assert_difference 'JournalDetail.count', 1 do
1230 1243 i.save!
1231 1244 end
1232 1245 end
1233 1246
1234 1247 detail = JournalDetail.first(:order => 'id DESC')
1235 1248 assert_equal i, detail.journal.journalized
1236 1249 assert_equal 'attr', detail.property
1237 1250 assert_equal 'description', detail.prop_key
1238 1251 assert_equal old_description, detail.old_value
1239 1252 assert_equal new_description, detail.value
1240 1253 end
1241 1254
1242 1255 def test_blank_descriptions_should_not_be_journalized
1243 1256 IssueCustomField.delete_all
1244 1257 Issue.update_all("description = NULL", "id=1")
1245 1258
1246 1259 i = Issue.find(1)
1247 1260 i.init_journal(User.find(2))
1248 1261 i.subject = "blank description"
1249 1262 i.description = "\r\n"
1250 1263
1251 1264 assert_difference 'Journal.count', 1 do
1252 1265 assert_difference 'JournalDetail.count', 1 do
1253 1266 i.save!
1254 1267 end
1255 1268 end
1256 1269 end
1257 1270
1258 1271 def test_journalized_multi_custom_field
1259 1272 field = IssueCustomField.create!(:name => 'filter', :field_format => 'list', :is_filter => true, :is_for_all => true,
1260 1273 :tracker_ids => [1], :possible_values => ['value1', 'value2', 'value3'], :multiple => true)
1261 1274
1262 1275 issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'Test', :author_id => 1)
1263 1276
1264 1277 assert_difference 'Journal.count' do
1265 1278 assert_difference 'JournalDetail.count' do
1266 1279 issue.init_journal(User.first)
1267 1280 issue.custom_field_values = {field.id => ['value1']}
1268 1281 issue.save!
1269 1282 end
1270 1283 assert_difference 'JournalDetail.count' do
1271 1284 issue.init_journal(User.first)
1272 1285 issue.custom_field_values = {field.id => ['value1', 'value2']}
1273 1286 issue.save!
1274 1287 end
1275 1288 assert_difference 'JournalDetail.count', 2 do
1276 1289 issue.init_journal(User.first)
1277 1290 issue.custom_field_values = {field.id => ['value3', 'value2']}
1278 1291 issue.save!
1279 1292 end
1280 1293 assert_difference 'JournalDetail.count', 2 do
1281 1294 issue.init_journal(User.first)
1282 1295 issue.custom_field_values = {field.id => nil}
1283 1296 issue.save!
1284 1297 end
1285 1298 end
1286 1299 end
1287 1300
1288 1301 def test_description_eol_should_be_normalized
1289 1302 i = Issue.new(:description => "CR \r LF \n CRLF \r\n")
1290 1303 assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description
1291 1304 end
1292 1305
1293 1306 def test_saving_twice_should_not_duplicate_journal_details
1294 1307 i = Issue.find(:first)
1295 1308 i.init_journal(User.find(2), 'Some notes')
1296 1309 # initial changes
1297 1310 i.subject = 'New subject'
1298 1311 i.done_ratio = i.done_ratio + 10
1299 1312 assert_difference 'Journal.count' do
1300 1313 assert i.save
1301 1314 end
1302 1315 # 1 more change
1303 1316 i.priority = IssuePriority.find(:first, :conditions => ["id <> ?", i.priority_id])
1304 1317 assert_no_difference 'Journal.count' do
1305 1318 assert_difference 'JournalDetail.count', 1 do
1306 1319 i.save
1307 1320 end
1308 1321 end
1309 1322 # no more change
1310 1323 assert_no_difference 'Journal.count' do
1311 1324 assert_no_difference 'JournalDetail.count' do
1312 1325 i.save
1313 1326 end
1314 1327 end
1315 1328 end
1316 1329
1317 1330 def test_all_dependent_issues
1318 1331 IssueRelation.delete_all
1319 1332 assert IssueRelation.create!(:issue_from => Issue.find(1),
1320 1333 :issue_to => Issue.find(2),
1321 1334 :relation_type => IssueRelation::TYPE_PRECEDES)
1322 1335 assert IssueRelation.create!(:issue_from => Issue.find(2),
1323 1336 :issue_to => Issue.find(3),
1324 1337 :relation_type => IssueRelation::TYPE_PRECEDES)
1325 1338 assert IssueRelation.create!(:issue_from => Issue.find(3),
1326 1339 :issue_to => Issue.find(8),
1327 1340 :relation_type => IssueRelation::TYPE_PRECEDES)
1328 1341
1329 1342 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1330 1343 end
1331 1344
1332 1345 def test_all_dependent_issues_with_persistent_circular_dependency
1333 1346 IssueRelation.delete_all
1334 1347 assert IssueRelation.create!(:issue_from => Issue.find(1),
1335 1348 :issue_to => Issue.find(2),
1336 1349 :relation_type => IssueRelation::TYPE_PRECEDES)
1337 1350 assert IssueRelation.create!(:issue_from => Issue.find(2),
1338 1351 :issue_to => Issue.find(3),
1339 1352 :relation_type => IssueRelation::TYPE_PRECEDES)
1340 1353
1341 1354 r = IssueRelation.create!(:issue_from => Issue.find(3),
1342 1355 :issue_to => Issue.find(7),
1343 1356 :relation_type => IssueRelation::TYPE_PRECEDES)
1344 1357 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1345 1358
1346 1359 assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
1347 1360 end
1348 1361
1349 1362 def test_all_dependent_issues_with_persistent_multiple_circular_dependencies
1350 1363 IssueRelation.delete_all
1351 1364 assert IssueRelation.create!(:issue_from => Issue.find(1),
1352 1365 :issue_to => Issue.find(2),
1353 1366 :relation_type => IssueRelation::TYPE_RELATES)
1354 1367 assert IssueRelation.create!(:issue_from => Issue.find(2),
1355 1368 :issue_to => Issue.find(3),
1356 1369 :relation_type => IssueRelation::TYPE_RELATES)
1357 1370 assert IssueRelation.create!(:issue_from => Issue.find(3),
1358 1371 :issue_to => Issue.find(8),
1359 1372 :relation_type => IssueRelation::TYPE_RELATES)
1360 1373
1361 1374 r = IssueRelation.create!(:issue_from => Issue.find(8),
1362 1375 :issue_to => Issue.find(7),
1363 1376 :relation_type => IssueRelation::TYPE_RELATES)
1364 1377 IssueRelation.update_all("issue_to_id = 2", ["id = ?", r.id])
1365 1378
1366 1379 r = IssueRelation.create!(:issue_from => Issue.find(3),
1367 1380 :issue_to => Issue.find(7),
1368 1381 :relation_type => IssueRelation::TYPE_RELATES)
1369 1382 IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
1370 1383
1371 1384 assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
1372 1385 end
1373 1386
1374 1387 context "#done_ratio" do
1375 1388 setup do
1376 1389 @issue = Issue.find(1)
1377 1390 @issue_status = IssueStatus.find(1)
1378 1391 @issue_status.update_attribute(:default_done_ratio, 50)
1379 1392 @issue2 = Issue.find(2)
1380 1393 @issue_status2 = IssueStatus.find(2)
1381 1394 @issue_status2.update_attribute(:default_done_ratio, 0)
1382 1395 end
1383 1396
1384 1397 teardown do
1385 1398 Setting.issue_done_ratio = 'issue_field'
1386 1399 end
1387 1400
1388 1401 context "with Setting.issue_done_ratio using the issue_field" do
1389 1402 setup do
1390 1403 Setting.issue_done_ratio = 'issue_field'
1391 1404 end
1392 1405
1393 1406 should "read the issue's field" do
1394 1407 assert_equal 0, @issue.done_ratio
1395 1408 assert_equal 30, @issue2.done_ratio
1396 1409 end
1397 1410 end
1398 1411
1399 1412 context "with Setting.issue_done_ratio using the issue_status" do
1400 1413 setup do
1401 1414 Setting.issue_done_ratio = 'issue_status'
1402 1415 end
1403 1416
1404 1417 should "read the Issue Status's default done ratio" do
1405 1418 assert_equal 50, @issue.done_ratio
1406 1419 assert_equal 0, @issue2.done_ratio
1407 1420 end
1408 1421 end
1409 1422 end
1410 1423
1411 1424 context "#update_done_ratio_from_issue_status" do
1412 1425 setup do
1413 1426 @issue = Issue.find(1)
1414 1427 @issue_status = IssueStatus.find(1)
1415 1428 @issue_status.update_attribute(:default_done_ratio, 50)
1416 1429 @issue2 = Issue.find(2)
1417 1430 @issue_status2 = IssueStatus.find(2)
1418 1431 @issue_status2.update_attribute(:default_done_ratio, 0)
1419 1432 end
1420 1433
1421 1434 context "with Setting.issue_done_ratio using the issue_field" do
1422 1435 setup do
1423 1436 Setting.issue_done_ratio = 'issue_field'
1424 1437 end
1425 1438
1426 1439 should "not change the issue" do
1427 1440 @issue.update_done_ratio_from_issue_status
1428 1441 @issue2.update_done_ratio_from_issue_status
1429 1442
1430 1443 assert_equal 0, @issue.read_attribute(:done_ratio)
1431 1444 assert_equal 30, @issue2.read_attribute(:done_ratio)
1432 1445 end
1433 1446 end
1434 1447
1435 1448 context "with Setting.issue_done_ratio using the issue_status" do
1436 1449 setup do
1437 1450 Setting.issue_done_ratio = 'issue_status'
1438 1451 end
1439 1452
1440 1453 should "change the issue's done ratio" do
1441 1454 @issue.update_done_ratio_from_issue_status
1442 1455 @issue2.update_done_ratio_from_issue_status
1443 1456
1444 1457 assert_equal 50, @issue.read_attribute(:done_ratio)
1445 1458 assert_equal 0, @issue2.read_attribute(:done_ratio)
1446 1459 end
1447 1460 end
1448 1461 end
1449 1462
1450 1463 test "#by_tracker" do
1451 1464 User.current = User.anonymous
1452 1465 groups = Issue.by_tracker(Project.find(1))
1453 1466 assert_equal 3, groups.size
1454 1467 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1455 1468 end
1456 1469
1457 1470 test "#by_version" do
1458 1471 User.current = User.anonymous
1459 1472 groups = Issue.by_version(Project.find(1))
1460 1473 assert_equal 3, groups.size
1461 1474 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1462 1475 end
1463 1476
1464 1477 test "#by_priority" do
1465 1478 User.current = User.anonymous
1466 1479 groups = Issue.by_priority(Project.find(1))
1467 1480 assert_equal 4, groups.size
1468 1481 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1469 1482 end
1470 1483
1471 1484 test "#by_category" do
1472 1485 User.current = User.anonymous
1473 1486 groups = Issue.by_category(Project.find(1))
1474 1487 assert_equal 2, groups.size
1475 1488 assert_equal 3, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1476 1489 end
1477 1490
1478 1491 test "#by_assigned_to" do
1479 1492 User.current = User.anonymous
1480 1493 groups = Issue.by_assigned_to(Project.find(1))
1481 1494 assert_equal 2, groups.size
1482 1495 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1483 1496 end
1484 1497
1485 1498 test "#by_author" do
1486 1499 User.current = User.anonymous
1487 1500 groups = Issue.by_author(Project.find(1))
1488 1501 assert_equal 4, groups.size
1489 1502 assert_equal 7, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1490 1503 end
1491 1504
1492 1505 test "#by_subproject" do
1493 1506 User.current = User.anonymous
1494 1507 groups = Issue.by_subproject(Project.find(1))
1495 1508 # Private descendant not visible
1496 1509 assert_equal 1, groups.size
1497 1510 assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
1498 1511 end
1499 1512
1500 1513 def test_recently_updated_scope
1501 1514 #should return the last updated issue
1502 1515 assert_equal Issue.reorder("updated_on DESC").first, Issue.recently_updated.limit(1).first
1503 1516 end
1504 1517
1505 1518 def test_on_active_projects_scope
1506 1519 assert Project.find(2).archive
1507 1520
1508 1521 before = Issue.on_active_project.length
1509 1522 # test inclusion to results
1510 1523 issue = Issue.generate_for_project!(Project.find(1), :tracker => Project.find(2).trackers.first)
1511 1524 assert_equal before + 1, Issue.on_active_project.length
1512 1525
1513 1526 # Move to an archived project
1514 1527 issue.project = Project.find(2)
1515 1528 assert issue.save
1516 1529 assert_equal before, Issue.on_active_project.length
1517 1530 end
1518 1531
1519 1532 context "Issue#recipients" do
1520 1533 setup do
1521 1534 @project = Project.find(1)
1522 1535 @author = User.generate!
1523 1536 @assignee = User.generate!
1524 1537 @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
1525 1538 end
1526 1539
1527 1540 should "include project recipients" do
1528 1541 assert @project.recipients.present?
1529 1542 @project.recipients.each do |project_recipient|
1530 1543 assert @issue.recipients.include?(project_recipient)
1531 1544 end
1532 1545 end
1533 1546
1534 1547 should "include the author if the author is active" do
1535 1548 assert @issue.author, "No author set for Issue"
1536 1549 assert @issue.recipients.include?(@issue.author.mail)
1537 1550 end
1538 1551
1539 1552 should "include the assigned to user if the assigned to user is active" do
1540 1553 assert @issue.assigned_to, "No assigned_to set for Issue"
1541 1554 assert @issue.recipients.include?(@issue.assigned_to.mail)
1542 1555 end
1543 1556
1544 1557 should "not include users who opt out of all email" do
1545 1558 @author.update_attribute(:mail_notification, :none)
1546 1559
1547 1560 assert !@issue.recipients.include?(@issue.author.mail)
1548 1561 end
1549 1562
1550 1563 should "not include the issue author if they are only notified of assigned issues" do
1551 1564 @author.update_attribute(:mail_notification, :only_assigned)
1552 1565
1553 1566 assert !@issue.recipients.include?(@issue.author.mail)
1554 1567 end
1555 1568
1556 1569 should "not include the assigned user if they are only notified of owned issues" do
1557 1570 @assignee.update_attribute(:mail_notification, :only_owner)
1558 1571
1559 1572 assert !@issue.recipients.include?(@issue.assigned_to.mail)
1560 1573 end
1561 1574 end
1562 1575
1563 1576 def test_last_journal_id_with_journals_should_return_the_journal_id
1564 1577 assert_equal 2, Issue.find(1).last_journal_id
1565 1578 end
1566 1579
1567 1580 def test_last_journal_id_without_journals_should_return_nil
1568 1581 assert_nil Issue.find(3).last_journal_id
1569 1582 end
1570 1583
1571 1584 def test_journals_after_should_return_journals_with_greater_id
1572 1585 assert_equal [Journal.find(2)], Issue.find(1).journals_after('1')
1573 1586 assert_equal [], Issue.find(1).journals_after('2')
1574 1587 end
1575 1588
1576 1589 def test_journals_after_with_blank_arg_should_return_all_journals
1577 1590 assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
1578 1591 end
1579 1592 end
General Comments 0
You need to be logged in to leave comments. Login now