|
|
@ -224,9 +224,15 @@ module Project::Copy |
|
|
|
next if role_ids.empty? |
|
|
|
next if role_ids.empty? |
|
|
|
new_member.role_ids = role_ids |
|
|
|
new_member.role_ids = role_ids |
|
|
|
new_member.project = self |
|
|
|
new_member.project = self |
|
|
|
Redmine::Hook.call_hook(:copy_project_add_member, new_member: new_member, member: member) |
|
|
|
|
|
|
|
self.memberships << new_member |
|
|
|
self.memberships << new_member |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Update the omitted attributes for the copied memberships |
|
|
|
|
|
|
|
self.memberships.each do |new_member| |
|
|
|
|
|
|
|
member = project.memberships.find_by_user_id(new_member.user_id) |
|
|
|
|
|
|
|
Redmine::Hook.call_hook(:copy_project_add_member, new_member: new_member, member: member) |
|
|
|
|
|
|
|
new_member.save |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
# Copies queries from +project+ |
|
|
|
# Copies queries from +project+ |
|
|
|