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