2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
class DynamicField
|
|
|
|
class Dropdown < Import::OTRS::DynamicField
|
|
|
|
def init_callback(dynamic_field)
|
|
|
|
@attribute_config.merge!(
|
|
|
|
data_type: 'select',
|
|
|
|
data_option: {
|
2017-08-23 14:41:01 +00:00
|
|
|
default: '',
|
|
|
|
multiple: false,
|
|
|
|
options: dynamic_field['Config']['PossibleValues'],
|
|
|
|
nulloption: dynamic_field['Config']['PossibleNone'] == '1',
|
|
|
|
null: true,
|
|
|
|
translate: dynamic_field['Config']['TranslatableValues'] == '1',
|
2016-11-25 16:10:37 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
2022-05-10 10:21:53 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def skip?(dynamic_field)
|
|
|
|
!dynamic_field['Config']['PossibleValues']
|
|
|
|
end
|
2016-11-25 16:10:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|