|
|
@ -763,11 +763,13 @@ class WorkPackage < ActiveRecord::Base |
|
|
|
if new_record? # set default values for new records only |
|
|
|
if new_record? # set default values for new records only |
|
|
|
self.status ||= Status.default |
|
|
|
self.status ||= Status.default |
|
|
|
self.priority ||= IssuePriority.active.default |
|
|
|
self.priority ||= IssuePriority.active.default |
|
|
|
if project |
|
|
|
set_default_type if project |
|
|
|
self.type ||= project.types.default.order(:position).first || |
|
|
|
|
|
|
|
project.types.order(:position).first |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_default_type |
|
|
|
|
|
|
|
self.type ||= project.types.default.order(:position).first || |
|
|
|
|
|
|
|
project.types.order(:position).first |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def add_time_entry_for(user, attributes) |
|
|
|
def add_time_entry_for(user, attributes) |
|
|
|