multiselect.rb 824 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. class DynamicField
  5. class Multiselect < Import::OTRS::DynamicField
  6. def init_callback(dynamic_field)
  7. @attribute_config.merge!(
  8. data_type: 'multiselect',
  9. data_option: {
  10. default: '',
  11. multiple: true,
  12. options: dynamic_field['Config']['PossibleValues'],
  13. nulloption: dynamic_field['Config']['PossibleNone'] == '1',
  14. null: true,
  15. translate: dynamic_field['Config']['TranslatableValues'] == '1',
  16. }
  17. )
  18. end
  19. private
  20. def skip?(dynamic_field)
  21. !dynamic_field['Config']['PossibleValues']
  22. end
  23. end
  24. end
  25. end
  26. end