summaryrefslogtreecommitdiffstats
path: root/app/controllers/custom_fields_controller.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-12-26 01:36:19 +0000
committerGo MAEDA <maeda@farend.jp>2020-12-26 01:36:19 +0000
commit972f00eb473ffd07292bb0960428c0181046b613 (patch)
treec401a9b942d67ca555bf8391da3fa9f563c030be /app/controllers/custom_fields_controller.rb
parent46156e08a9a61a07c89045ad6e6d9ccbaebd875a (diff)
downloadredmine-972f00eb473ffd07292bb0960428c0181046b613.tar.gz
redmine-972f00eb473ffd07292bb0960428c0181046b613.zip
Create custom field by copy (#34307).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@20692 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/custom_fields_controller.rb')
-rw-r--r--app/controllers/custom_fields_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb
index 893bc4819..41a41ebe9 100644
--- a/app/controllers/custom_fields_controller.rb
+++ b/app/controllers/custom_fields_controller.rb
@@ -98,6 +98,9 @@ class CustomFieldsController < ApplicationController
if @custom_field.nil?
render :action => 'select_type'
else
+ if params[:copy].present? && (@copy_from = CustomField.find_by(id: params[:copy]))
+ @custom_field.copy_from(@copy_from)
+ end
@custom_field.safe_attributes = params[:custom_field]
end
end