trabajo-afectivo/lib/import/otrs/dynamic_field/checkbox.rb

25 lines
626 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module Import
module OTRS
class DynamicField
class Checkbox < Import::OTRS::DynamicField
def init_callback(dynamic_field)
@attribute_config.merge!(
data_type: 'boolean',
data_option: {
default: dynamic_field['Config']['DefaultValue'] == '1',
options: {
true => 'Yes',
false => 'No',
},
null: true,
translate: true,
}
)
end
end
end
end
end