checkbox.rb 626 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. class DynamicField
  5. class Checkbox < Import::OTRS::DynamicField
  6. def init_callback(dynamic_field)
  7. @attribute_config.merge!(
  8. data_type: 'boolean',
  9. data_option: {
  10. default: dynamic_field['Config']['DefaultValue'] == '1',
  11. options: {
  12. true => 'Yes',
  13. false => 'No',
  14. },
  15. null: true,
  16. translate: true,
  17. }
  18. )
  19. end
  20. end
  21. end
  22. end
  23. end