|
|
@ -669,7 +669,9 @@ class WorkPackage < ActiveRecord::Base |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if work_package.save |
|
|
|
if work_package.save |
|
|
|
unless options[:copy] |
|
|
|
if options[:copy] |
|
|
|
|
|
|
|
create_and_save_journal_note work_package, options[:journal_note] |
|
|
|
|
|
|
|
else |
|
|
|
# Manually update project_id on related time entries |
|
|
|
# Manually update project_id on related time entries |
|
|
|
TimeEntry.update_all("project_id = #{new_project.id}", {:work_package_id => id}) |
|
|
|
TimeEntry.update_all("project_id = #{new_project.id}", {:work_package_id => id}) |
|
|
|
|
|
|
|
|
|
|
@ -1009,4 +1011,11 @@ class WorkPackage < ActiveRecord::Base |
|
|
|
errors.messages[:attachments].first << " - #{invalid_attachment.errors.full_messages.first}" |
|
|
|
errors.messages[:attachments].first << " - #{invalid_attachment.errors.full_messages.first}" |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_and_save_journal_note(work_package, journal_note) |
|
|
|
|
|
|
|
if work_package && journal_note |
|
|
|
|
|
|
|
work_package.add_journal User.current, journal_note |
|
|
|
|
|
|
|
work_package.save! |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|