2016-11-25 16:10:37 +00:00
|
|
|
# this require is required (hehe) because of Rails autoloading
|
|
|
|
# which causes strange behavior not inheriting correctly
|
|
|
|
# from Import::OTRS::DynamicField
|
2018-04-26 08:55:53 +00:00
|
|
|
require_dependency 'import/otrs/dynamic_field'
|
2016-11-25 16:10:37 +00:00
|
|
|
|
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
class DynamicField
|
|
|
|
class DateTime < Import::OTRS::DynamicField
|
|
|
|
def init_callback(dynamic_field)
|
|
|
|
@attribute_config.merge!(
|
|
|
|
data_type: 'datetime',
|
|
|
|
data_option: {
|
|
|
|
future: dynamic_field['Config']['YearsInFuture'] != '0',
|
|
|
|
past: dynamic_field['Config']['YearsInPast'] != '0',
|
|
|
|
diff: dynamic_field['Config']['DefaultValue'].to_i / 60 / 60,
|
2017-08-23 14:41:01 +00:00
|
|
|
null: true,
|
2016-11-25 16:10:37 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|