checkbox.rb 545 B

12345678910111213141516171819202122
  1. module Import
  2. module OTRS
  3. class DynamicField
  4. class Checkbox < Import::OTRS::DynamicField
  5. def init_callback(dynamic_field)
  6. @attribute_config.merge!(
  7. data_type: 'boolean',
  8. data_option: {
  9. default: dynamic_field['Config']['DefaultValue'] == '1',
  10. options: {
  11. true => 'Yes',
  12. false => 'No',
  13. },
  14. null: true,
  15. translate: true,
  16. }
  17. )
  18. end
  19. end
  20. end
  21. end
  22. end