helper.rb 660 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. module Helper
  5. extend self
  6. private
  7. def from_mapping(record)
  8. result = {}
  9. # use the mapping of the class in which
  10. # this module gets extended
  11. self.class::MAPPING.each do |key_sym, value|
  12. key = key_sym.to_s
  13. next if !record.key?(key)
  14. result[value] = record[key]
  15. end
  16. result
  17. end
  18. def active?(record)
  19. case record['ValidID'].to_s
  20. when '3', '2', '0'
  21. false
  22. else
  23. true
  24. end
  25. end
  26. end
  27. end
  28. end